#include <iostream>
#include <functional>
#include <algorithm>
#include <cstdlib>

#define SIZE 10
#define MAX 10000
#define TOP 3

using namespace std;

int main() {
 int i = 0;
 int height[SIZE];
 char buf[256];

 while(i < SIZE) {
  cin >> buf;

  if(atoi(buf) != 0) {
   if(atoi(buf) <= MAX) {
    height[i] = atoi(buf);
    i++;
   }
  }
 }

 sort(height, height + SIZE, greater<int>());

 for(i = 0;i < TOP;i++) {
  cout << height[i] << endl;
 }

 return 0;
}