#include <iostream>
using namespace std;
int main(void){
    int x, rank01,rank02,rank03 = 0;
    
    for(int i = 0; i < 10; i++){
        cin >> x;
        if(rank01 < x){
            rank03 = rank02;
            rank02 = rank01;
            rank01 = x;
        }
        else if(rank02 < x){
            rank03 = rank02;
            rank02 = x;
        }
        else if (rank03 < x){
            rank03 = x;
        }
       
       std::cout << rank01 << std::endl<< rank02 << std::endl << rank03 << std::endl; 
       
    }
}