#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	int a = 0,b=0,c=0,d=0;
	for (int i = 0; i < 10;i++){
		cin >> a;
		if (a>b){
			a = b;
			b = c;
			c = d;

		}

	}
	cout << b << endl << c << endl << d;
	return 0;
}