#include <stdio.h>
#define N 10

int main(void){
 int i=1,data[3],t;
 for(i=0;i<3;i++) data[i] = 0;
 while(1){
  scanf("%d",&t);
  if(t>data[0]){
   data[2] = data[1];
   data[1] = data[0];
   data[0] = t;
  }
  else if(t>data[1]){
   data[2] = data[1];
   data[1] = t;
  }
  else if(t>data[2]) data[2] = t;
  i++;
  if(i>N) break;
 }
 return 0;
}