#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    vector<int> v(10);
    int index = 0;  
    for(int i = 0; i< 10; i++){
        cin >> v[i];
    }
    cout << *max_element(v.begin(),v.end()) << endl;
    index = distance(v.begin(),max_element(v.begin(),v.end()));
    v[index] = 0;
    cout << *max_element(v.begin(),v.end()) << endl;
    index = distance(v.begin(),max_element(v.begin(),v.end()));
    v[index] = 0;
    cout << *max_element(v.begin(),v.end()) << endl;
    index = distance(v.begin(),max_element(v.begin(),v.end()));
    v[index] = 0;
}