#include <bits/stdc++.h>
using namespace std;
struct point{
int x,y;
bool operator<(const point &r) const
{
if(x==r.x)
return y<r.y;
else
return x<r.x;
}
};
int main(int argc, const char * argv[]) {
int t;
set<point> v;
cin>>t;
for(int i=0;i<t;i++)
{
point temp;
cin>>temp.x>>temp.y;
v.insert(temp);
}
for(set<point>::iterator it =v.begin();it!=v.end();it++)
{
cout << "("<< it -> x << "," << it -> y << ")" << endl;
}
return 0;
}