import std.stdio;
import std.algorithm;
void main(){
	int[] n;
	n.length = 10;
	for(int i;i<10;i++)
		readf("%d\n", &n[i]);
	foreach(int i;sort!((int a, int b){return a > b;})(n)[0..3])
		writeln(i);
}