#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
	int buf[3]={-1}, h, count=0;
	
	while(scanf("%d", &h) != EOF) {
		count++;
		if(h >= min(buf[0], min(buf[1], buf[2]))) {
			sort(buf, buf+3);
			reverse(buf, buf+3);
			buf[2] = h;
		}
	}
	sort(buf, buf+3);
	reverse(buf, buf+3);
	if(count <3) {
		for(int i=1; i<=count; i++) {
			printf("%d\n", buf[i-1]);
		}
	}
	else {
		for(int i=1; i<=3; i++)
			printf("%d\n", buf[i-1]);
	}
	return 0;
}