#include<stdio.h>

int main(){
	
	int a[3];
	int o, j;

	a[0] = a[1] = a[2] = 0;
	
	for(j = 0; j < 9; j++){
		
		scanf("%d\n",&o);
		
		if(o == 0){
			
			continue;
			
		}
		
		if(a[0] < o){
			
			a[2] = a[1];
			a[1] = a[0];
			a[0] = o;
			
		}else if(a[1] < o){
			
			a[2] = a[1];
			a[1] = o;
			
		}else if(a[2] < o){
			
			a[2] = o;
			
		}
		
	}
	
	printf("%d\n", a[0]);
	printf("%d\n", a[1]);
	printf("%d\n", a[2]);
	
    return 0;
}