#include<iostream>
using namespace std;
int main(){
  int m[10];
  int f=0;
  int s=0;
  int t=0;
  for(int i = 0; i < 10 ; i ++ ){
    cin>>m[i];
  }
  for(int i = 0; i < 10 ; i ++ ){
    if(m[f]<m[i])
      f=i;
  }
  //  cout<<"max mountain tall is "<<m[f]<<endl;
  // cout<<"number is"<<f<<endl;
  if(f==0)
    s=1;

  for( int i=0; i<10 ;i++){
    if(m[s]<m[i] && i!=f)
      s=i;
  }
  //cout<<"secount tall mountain is "<<m[s]<<endl;
  if(f==0 || s==0)
    t=1;
  if(f==1 || s==1)
    t=2;
  for(int i=0;i<10;i++){
    if(m[t]<m[i] && i!=f && i!=s)
      t=i;
  }
  // cout<<"third tall mountain is"<<m[t]<<endl;
  //cout<<"the number is "<<t<<endl;
  cout<<m[f]<<endl;
  cout<<m[s]<<endl;
  cout<<m[t]<<endl;






  return 0;
}