#include <bits/stdc++.h> using namespace std; int data1[4][5]; int res[5][2]; int main(){ while(scanf("%d",&data1[0][0])!=EOF){ memset(res,-1,10*sizeof(int)); //cout<<res[0][1]<<" "<<res[0][2]<<endl;; int i=1; while(i<20){ scanf("%d",&data1[i/5][i%5]); //cout<<i/4<<" "<<i%5<<endl; i++; } /*for(i=0;i<4;i++){ for(int j=0;j<5;j++){ cout<<data[i][j]<<" "; } cout<<endl; }*/ for(i=0;i<4;i++){ for(int j=0;j<5;j++){ if(res[j][0]==-1){ res[j][0]=i; //cout<<data[i][j]<<"fangl"<<endl; } else if(res[j][1]==-1){ res[j][1]=i; //cout<<data[i][j]<<"fangl1"<<endl; } //else if(data[i][j]==data[res[j][0]][j]||data[i][j]==data[res[j][1]][j]) // continue; else if(data1[i][j]>data1[res[j][0]][j]&&data1[i][j]>data1[res[j][1]][j]){ if(data1[res[j][0]][j]>data1[res[j][1]][j]){ res[j][1]=i; } else res[j][0]=i; } else if(data1[i][j]>data1[res[j][0]][j]){ res[j][0]=i; //cout<<data[i][j]<<"fhuanl"<<endl; } else if(data1[i][j]>data1[res[j][1]][j]){ res[j][1]=i; //cout<<data[i][j]<<"fang333l"<<endl; } } } int temp; for(i=0;i<5;i++){ if(res[i][0]>res[i][1]){ temp=res[i][0]; res[i][0]=res[i][1]; res[i][1]=temp; } } for(i=0;i<2;i++){ for(int j=0;j<5;j++){ //cout<<res[j][i]<<"hhh"<<endl; printf("%d ",data1[res[j][i]][j]); } printf("\n"); } } return 0; }