#include <fstream>
#include <algorithm>
using namespace std;
ifstream f("infasuratoare.in");
ofstream g("infasuratoare.out");
struct ura
{
double x, y;
}v[120002];
int arie (int xa,int xb,int xc,int ya,int yb,int yc)
{
if ((xa*yb+xb*yc+xc*ya-xc*ya-xa*yc-xb*ya)>=0)
return 1;
else return 0;
}
bool cmp (ura a, ura b)
{
if (a.x>b.x)
return false;
else {
if (a.x<b.x)
return true;
else
{
if (a.y<b.y)
return true;
else return false;
}
}
}
int main()
{
int n;
f>>n;
for (int i=1; i<=n;i++)
f>>v[i].x>>v[i].y;
sort (v+1,v+n+1, cmp);
for (int i=1; i<=n; i++)
g<<v[i].x<<v[i].y;
return 0;
}