n = int(input()) # 輸入整數 n,表示接下來輸入的數量
s = list(map(int, input().split())) # 輸入 n 個整數,存成列表s
maxf = -1 # 用來記錄小於60的最大分數(預設-1表示沒找到)
minp = 101 # 用來記錄大於等於60的最小分數(預設101表示沒找到)
for i in s:
if i < 60:
maxf = max(maxf, i) # 找出小於60的最大值
else:
minp = min(minp, i) # 找出大於等於60的最小值
print(*sorted(s)) # 輸出排序後的列表(從小到大)
print("best case" if maxf == -1 else maxf) # 如果沒有小於60的分數,輸出 "best case",否則輸出 maxf
print("worst case" if minp == 101 else minp) # 如果沒有大於等於60的分數,輸出 "worst case",否則輸出 minp
maxf
)minp
)"best case"
"worst case"