#include <iostream>
using namespace std;

enum SORTORDER {ASC, DESC};

void SelectSort(int, int[], int);

int main(){
	const int SIZEINPUT = 10;
	const int NUMMIN = 1;
	const int NUMMAX = 10000;
	const int SIZEOUTPUT = 3;
	const int SORTORDER = DESC;

	int inputnum;
	int num[SIZEINPUT];
	int i;

	//input
	i = 0;
	while(i<SIZEINPUT){
		cin >> inputnum;
		if(inputnum>=NUMMIN && inputnum<=NUMMAX){
			num[i] = inputnum;
			i++;
		}else{
			cout << "Number " << inputnum << " is denied!" << endl;
		}
	}
	SelectSort(SIZEINPUT, &num[0], SORTORDER);
	//output
	i = 0;
	while(i<SIZEOUTPUT){
		cout << num[i] << endl;
		i++;
	}
}

void SelectSort(int n, int num[], int order){
	int i, j, k;
	int extreme;
	bool chk = false;

	for(i=0; i<n-1; i++){
		extreme = num[i];
		k = i;
		for(j=i+1; j<n; j++){
			switch(order){
			case ASC:
				chk = (num[j]<extreme);
				break;
			case DESC:
				chk = (extreme<num[j]);
				break;
			default:
				;
			}
			if(chk){
				extreme = num[j];
				k = j;
			}
		}
		num[k] = num[i];
		num[i] = extreme;
	}
}