#include <iostream>

using namespace std;

int main()
{
    int first=0,second=0,third=0;
    int moun[10];
    for(int i=0;i<10;i++){
        cin >> moun[i];
    }
    for(int i=0;i<10;i++){
        first<moun[i] ? first=moun[i]:first;
    }
    cout << first << endl;
    for(int i=0;i<10;i++){
        second<moun[i] && moun[i]<first ? second=moun[i]:second;
    }
    cout << second << endl;
    for(int i=0;i<10;i++){
        third<moun[i] && moun[i]<second ? third=moun[i]:third;
    }
    cout << third << endl;
    return 0;
}