#include<cstdio>
#define rep(i,a,b) for(int i = (a); i<=(b); i++)
using namespace std;
int a[3];
int main()
{
    int i,j;
        while(scanf("%d",&i)==1)
        {
            if(i>a[0]) { a[2]=a[1]; a[1]=a[2]; a[0]=i;}
            else if(i>a[1]) { a[2]=a[1];a[1]=i;}
            else if(i>a[2]) a[2]=i;
        }
        rep(i,0,2) printf("%d\n",a[i]);
        return 0;
}