n = int(input())
score = list(map(int, input().split()))
score = sorted(score)
p = []
f = []
print(*score)
for i in range(n):
if(score[i] >= 60):
p.append(score[i])
else:
f.append(score[i])
f = sorted(f,reverse = True) //也可以用max
if(len(p) == 0):
print(f[0])
print("worst case")
elif(len(f) == 0):
print("best case")
print(p[0])
else:
print(f[0])
print(p[0])