#include<iostream>
using namespace std;

int main(){

  int a[10],i=1;
  cin << i;
  while(cin >> a[i]){
    i++
  }
  sort(a,a+i);
  cout << a[i-1] << endl;
  cout << a[n-2] << endl;
  cout << a[i-3] << endl;

  return 0;
}