#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
int grade[n];
for (int i = 0; i < n; i++) scanf("%d", grade+i);
sort(grade, grade+n);
for (int i = 0; i < n; i++) printf("%d ", grade[i]);
printf("\n");
int index = lower_bound(grade, grade+n, 60) - grade;
if (index == 0) printf("best case\n"), printf("%d\n", grade[index]);
else if (index == n) printf("%d\n", grade[--index]), printf("worst case\n");
else printf("%d\n", grade[index-1]), printf("%d\n", grade[index]);
}