#include <iostream>

using namespace std;

int main() {
    int top[3] {};

    for (int i = 0; i < 10; ++i) {
        int h;
        cin >> h;

        if (h > top[2]) {
            if (h > top[1]) {
                top[2] = top[1];
                if (h > top[0]) {
                    top[1] = top[0];
                    top[0] = h;
                }
                else top[1] = h;
            }
            else top[2] = h;
        }

    }

    for (auto t : top) {
        cout << t << endl;
    }
}