#include <iostream.h>
#include <stdlib.h>

int main()
{int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
int ok,t;
do
{ok=1;
for(int i=0;i<n;i++)
if(a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;ok=0;}}
while(!ok);
cout<<a[n-3]<<" "<<a[n-1]<<" "<<a[n-2]<<"\n";

      system("PAUSE");
      return 0;
}
