#include<stdio.h>
int main(void) {
	int i, mountain[10];
	int n = 0;
	int l = 0;
	int m = 0;
	for (i = 0;i < 10;i++) {
		scanf("%d", &mountain[i]);
	}
	for (i = 0;i < 10;i++) {
		if (mountain[i] > m) m = mountain[i];
	}
	printf("%d\n", m);
	for (i = 0;i < 10;i++) {
	if (mountain[i] > n && mountain[i] != m) n = mountain[i];
	}
	printf("%d\n", n);
	for (i = 0;i < 10; i++) {
		if (mountain[i] > l && mountain[i] != m && mountain[i] != n) l = mountain[i];
	}
	printf("%d\n", l);

	return 0;
}