@staticmethod
def b():
    (n, *a) = map(int, sys.stdin.read().split())
    print(sorted(set(a))[(- 2)])
@staticmethod
def b():
    (n, *a) = map(int, sys.stdin.read().split())
    print(sorted(set(a))[(- 2)])