#include <cstdio>
#include <cstring>

int main()
{
	int top[3];
	memset(top, 0, sizeof(top));
	int h;
	while (scanf("%d", &h) != EOF)
	{
		for (int i = 0; i < 3; ++i)
		{
			if (top[i] < h)
			{
				for (int j = 2; j > i; --j)
					top[j] = top[j-1];
				top[i] = h;
				break;
			}
		}
	}
	for (int i = 0; i < 3; ++i)
		printf("%d\n", top[i]);

	return 0;
}