#include<stdio.h>
int main(void){
	int i;
	int a[10];
	int x=0, y=0, z=0;
	
	for(i=0;i<10;i++){
		do{
			printf("山の高さ%d(整数)",i+1);
			scanf("%d",&a[i]);
		}while(a[i]<0||10000<a[i])
		
		if(a[i]>x){
			z=y;
			y=x;
			x=a[i];
		}
		else if(a[i]>y){
			z=y;
			y=a[i];
		}
		else if(a[i]>z){
			z=a[i];
		}
	}
	
	printf("%d\n%d\n%d\n",x,y,z);
	
	return 0;
}