#include <bits/stdc++.h>
using namespace std;
int main() {
int n, low = 0, high = 100;
bool c = 0, b = 0;
cin >> n;
int a[n];
for(int i = 0;i < n;i++){
cin >> a[i];
}
sort(a,a+n);
for(int i = 0;i < n;i++){
cout << a[i] << " ";
}
cout << "\n";
for(int i = 0;i < n;i++){
if(a[i] < 60){
low = max(low,a[i]);
b = 1;
}
if(a[i] >= 60){
high = min(high,a[i]);
c = 1;
}
}
if(b == 1)cout << low << "\n";
else{cout << "best case" << "\n";}
if(c == 1)cout << high << "\n";
else{cout << "worst case";}
}