#include<iostream>
using namespace std;
void output(int ab,int bc,int ca);
int main() {
	int mountain[10];
	int a, b, c;

	for (int i = 0; i < 10; i++) {
		cin >> mountain[i];
	}

	a = mountain[0];
	b = mountain[1];
	c = mountain[2];

	for (int y = 3; y <= 9; y++) {
		if (a <= b) {
			if (a <= c) {
				if (a < mountain[y]) {
					a = mountain[y];
				}
			}
			else {
				if (c < mountain[y]) {
					c = mountain[y];
				}
			}
		}
		else if (b <= c)
		{
			if (b < mountain[y]) {
				b = mountain[y];
			}
		}
	}
	if (a <= b) {
		if (a <= c) {
			if (b <= c) output(c, b, a);
			else output(b, c, a);
		}else output(b, a, c);
	}
	else if (a <= c) output(c, a, b);
	else if (b <= c) output(a, c, b);
	else output(a, b, c);
	char a____;
	cin >> a____;

	return 0;
}

void output(int ab, int bc, int ca) {
	cout << ab << "\n" << bc << "\n" << ca << "\n";
}