#53827: python


yujunweng677@gmail.com (翁于鈞)


x=input()
l=list(map(int,input().split()))
print(*(sorted(l)))
n = [x for x in sorted(l) if x < 60]
if n:
print(max(n))
else:
print("best case")
y=[x for x in sorted(l) if x >= 60]
if y:
print(min(y))
else:
print("worst case")