#33976: python解答


s11104220@school.saihs.edu.tw (施同學)


n=int(input())
sc=sorted(list(map(int,input().split(" "))))
print(*sc)
if sc[0]>=60:
    print("best case")
else:
    s=list(filter(lambda x:x<60,sc))[-1]
    print(s)
if sc[-1]<60:
    print("worst case")
else:
    s=list(filter(lambda x:x>=60,sc))[0]
    print(s)