#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
struct node{
int x;
double y;
string z;
};
const int N = 1E4 + 10;
node a[N];
bool cmp(node t, node q){
return t.x < q.x;
}
int main(){
int n; cin >> n;
for(int i = 0; i < n; i ++ ){
cin >> a[i].x >> a[i].y >> a[i].z;
}
sort(a, a + n, cmp);
for(int i = 0; i < n; i ++ ){
printf("%d %.2lf %s\n", a[i].x, a[i].y, a[i].z.c_str());
}
return 0;
}