import std.stdio;
import std.conv;
import std.string;

const int DATA = 10;

int main() {
  int max=-1, mid=-1, min=-1;
  for(int i=0; i<DATA; i++) {
    int d = to!(int)(chomp(readln));
    if(max < d) {
      min = mid;
      mid = max;
      max = d;
    }
    else if(mid < d) {
      min = mid;
      mid = d;
    }
    else if(min < d) {
      min = d;
    }
  }
  writeln(max, "\n", mid, "\n", min);

  return 0;
}