//
//  main.cpp
//  0001
//
//  Created by 竹内 文登 on 13/07/13.
//  Copyright (c) 2013年 竹内 文登. All rights reserved.
//

#include <iostream>
using namespace std;

int main()
{
    
    int i = 10,m[10];
    
    while(i>0){
        cin >> m[i];
        i--;
    }
    
    int max = m[0],index = 0;
    
    for(i = 0; i < 10 ; i++){
        if(max < m[i]){
            max = m[i];
            index = i;
        }
    }
    cout << m[index] << endl;;
    m[index] = 0;
    
    max = m[0];
    index = 0;
    
    for(i = 0; i < 10 ; i++){
        if(max < m[i]){
            max = m[i];
            index = i;
        }
    }
    cout << m[index] << endl;
    m[index] = 0;
    max = m[0];
    index = 0;
    
    for(i = 0; i < 10 ; i++){
        if(max < m[i]){
            max = m[i];
            index = i;
        }
    }
    cout << m[index] << endl;

    m[index] = 0;
    
    return 0;
}