input()
a=sorted(list(map(int,input().split(' '))))
for b in a: print(b,end=(' '))
for b in sorted(a,reverse=True):
if b<60:
print(f"\n{b}")
break
if b>=60: print('\nbest case')
for b in a:
if b>=60:
print(b)
break
if b<60: print('worst case')