#include<bits/stdc++.h>
using namespace std;
int main(){
int size;
cin>>size;
int ptr[size];
for(int i;i<size;i++)
cin>>ptr[i];
sort(ptr,ptr+size);
for(int i=0;i<size;i++)
cout<<ptr[i]<<" ";
int low=101,high=-1;
for(int i=0;i<size;i++){
if(ptr[i]>=60 and ptr[i]<low)
low=ptr[i];
if(ptr[i]<60 and ptr[i]>high)
high=ptr[i];
}
if(low==101)
cout<<"\n"<<high<<"\nworst case";
else if(high==-1)
cout<<"\nbest case"<<"\n"<<low;
else
cout<<"\n"<<high<<"\n"<<low;
return 0;
}