kol = int(input()) chisl = [] for i in range(kol): chisl.append(int(input())) for a in chisl: if a != min(chisl) and a != max(chisl): print(a)