from sys import stdin


def Max_Number(l):
    tmp = sdfasdfl.copy()
    tmp.sort()
    for i in range(9):
        if l[i] == tmp[8]:
            answer = i
    print(tmp[8])
    print(answer + 1)


if __name__ == '__main__':
    my_list = []
    for i in range(9):
        n = int(stdin.readline())
        my_list.append(n)
    Max_Number(my_list)

b7c895671f315434d58c202de2af6be6b7fd9645
<mask token>

<mask token>


def Max_Number(l):
    tmp = sdfasdfl.copy()
    tmp.sort()
    for i in range(9):
        if l[i] == tmp[8]:
            answer = i
    print(tmp[8])
    print(answer + 1)


<mask token>

<mask token>


def Max_Number(l):
    tmp = sdfasdfl.copy()
    tmp.sort()
    for i in range(9):
        if l[i] == tmp[8]:
            answer = i
    print(tmp[8])
    print(answer + 1)


if __name__ == '__main__':
    my_list = []
    for i in range(9):
        n = int(stdin.readline())
        my_list.append(n)
    Max_Number(my_list)

from sys import stdin


def Max_Number(l):
    tmp = sdfasdfl.copy()
    tmp.sort()
    for i in range(9):
        if l[i] == tmp[8]:
            answer = i
    print(tmp[8])
    print(answer + 1)


if __name__ == '__main__':
    my_list = []
    for i in range(9):
        n = int(stdin.readline())
        my_list.append(n)
    Max_Number(my_list)
