n=int(input())
list1=[int(x) for x in input().split()]
list1.sort()
print(*list1)
if list1[-1]<60:
highnotpass=list1[-1]
lowpass='worst case'
print(highnotpass)
print(lowpass)
elif list1[0]>=60:
highnotpass='best case'
lowpass=list1[0]
print(highnotpass)
print(lowpass)
else:
for i in range(n):
highnotpass=list1[i]
lowpass=list1[i+1]
if lowpass>=60:
break
print(highnotpass)
print(lowpass)