//JUST PRACTISING
#include<cstdio>
#include<iostream>
#include<list>
#include<algorithm>
#include<vector>
#include<utility>
using namespace std;
struct node
{
int u;
int w;
}road[10];
bool comp(node a,node b)
{
if(a.u<b.u)
return 1;
return 0;
}
int main()
{
for(int i=0;i<4;i++)
{ int a,b;
scanf("%d%d",&road[i].u,&road[i].w);
}
sort(road,road+4,comp);
printf("\n\n\n\n");
for(int i=0;i<4;i++)
{
printf("%d %d\n",road[i].u,road[i].w);
}
//system("pause");
}
Ly9KVVNUIFBSQUNUSVNJTkcKCiNpbmNsdWRlPGNzdGRpbz4KI2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGxpc3Q+CiNpbmNsdWRlPGFsZ29yaXRobT4KI2luY2x1ZGU8dmVjdG9yPgojaW5jbHVkZTx1dGlsaXR5Pgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpzdHJ1Y3Qgbm9kZQp7CiAgICBpbnQgdTsKICAgIGludCB3Owp9cm9hZFsxMF07Cgpib29sIGNvbXAobm9kZSBhLG5vZGUgYikKewogICAgaWYoYS51PGIudSkKICAgIHJldHVybiAxOwogICAgcmV0dXJuIDA7Cgp9CgppbnQgbWFpbigpCnsKICAgIGZvcihpbnQgaT0wO2k8NDtpKyspCiAgICB7ICBpbnQgYSxiOwogICAgICAgIHNjYW5mKCIlZCVkIiwmcm9hZFtpXS51LCZyb2FkW2ldLncpOwogICAgfQoKICAgICBzb3J0KHJvYWQscm9hZCs0LGNvbXApOwogcHJpbnRmKCJcblxuXG5cbiIpOwogICAgZm9yKGludCBpPTA7aTw0O2krKykKICAgIHsKICAgICAgICBwcmludGYoIiVkICAgJWRcbiIscm9hZFtpXS51LHJvYWRbaV0udyk7CiAgICB9CgogICAgLy9zeXN0ZW0oInBhdXNlIik7Cn0=