/* AOJ0001 */
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
  int h;
  vector< int > most;
  while(cin >> h, h){
    most.push_back(h);
  }
  sort(most.rbegin(),most.rend());
  for(int i = 0 ; i < 3 ; i++ ){
    cout << most[i] << endl;
  }
}