#include <iostream>

using namespace std;

int main(){
  int i=0;
  int input=-1;//入力
  int max =-1,mid = -1,min = -1;


  while(cin >> input ){
    if( min < input){
       min = input;
    }

    if(min > mid){
      swap(min,mid);
    }

    if(mid>max){
      swap(mid,max);
    }

  }

cout <<  max<<"\n"
<< mid<<"\n"
<< min<<"\n";

  return 0;
}

