#include<iostream>
 using namespace std;
int main(){
int input[10];
int first;
int second;
int third;
for(int i=0;i<30;i++){
cin>>input[i];
if(first<input[i]){first = input[i];}
else if(second<input[i-10]){second = input[i-10];}
else if(third<input[i-20]){third = input[i-20];}
}
cout<<first<<endl;
cout<<second<<endl;
cout<<third<<endl;
return 0;

}