#include <bits/stdc++.h>
using namespace std;
// #Maps #Hashing #IMP_NOTES
// https://www.geeksforgeeks.org/map-pairs-stl/
// https://www.geeksforgeeks.org/map-associative-containers-the-c-standard-template-library-stl/
int main() {
int n;
cin>> n;
map< pair<int,int>, int > m;
while(n--){
int x,y,data;
cin>> x >> y >> data;
m[{x,y}] = data;
}
for(auto it = m.begin();it != m.end();it++){
cout << (it->first).first;
cout << " ";
cout << (it->first).second;
cout << " ";
cout <<"data: ";
cout << (it->second)<<endl;
}
return 0;
}