#include <iostream>
using namespace std;

int Size = 10;

void ranking(const int* array) {
    int top1 = 0;
    int top2 = 0;
    int top3 = 0;
    for(int i = 0; i < Size; ++i) {
        if(array[i] > top1) {
            top3 = top2;
            top2 = top1;
            top1 = array[i];
        } else if(array[i] > top2) {
            top3 = top2;
            top2 = array[i];
        } else if(array[i] > top3) {
            top3 = array[i];
        }
    }
    cout << top1 << endl
         << top2 << endl
         << top3 << endl;
} 

int main(void) {
    int height[Size];
    
    for(int i = 0; i < Size; ++i) {
        while(true) {
            cout << "No." << i + 1 << " : " << flush;
            cin >> height[i];
            if(height[i] > 0) {
                break;
            }
        }
    }
    
    ranking(height);
}
