#include<iostream>
#include<algorithm>
using namespace std;
const int N=10010;
struct Data
{
int x;
double y;
string st;
bool operator<(const Data &t) const
{
return x<t.x;
}
}z[N];
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++) cin>>z[i].x>>z[i].y>>z[i].st;
sort(z,z+n);
for(int i=0;i<n;i++)
printf("%d %.2lf %s\n",z[i].x,z[i].y,z[i].st.c_str());
return 0;
}