#include<iostream>
using namespace std;
int main(){
	int a[10];
	for(int i=0;i<10;i++){
		scanf("%d",&a[i]);
		}
		int first=-1;
		int second=-1;
		int third=-1;
		for(int j=0;j<10;j++){
			if(a[j]>first){
				first=a[j];
			}
			else if(a[j]>second){
				second=a[j];
			}
			else if(a[j]>third){
				third=a[j];
			}
			cout<<first<<endl;
			cout<<second<<endl;
			cout<<third<<endl;
		}
		return 0;
}
		