In this problem we consider a special type of an auction, which is called the second-price auction. As in regular auction n bidders place a bid which is price a bidder ready to pay. The auction is closed, that is, each bidder secretly informs the organizer of the auction price he is willing to pay. After that, the auction winner is the participant who offered the highest price. However, he pay not the price he offers, but the highest price among the offers of other participants (hence the name: the second-price auction).

Write a program that reads prices offered by bidders and finds the winner and the price he will pay. Consider that all of the offered prices are different.


-----Input-----

The first line of the input contains n (2 ≤ n ≤ 1000) — number of bidders. The second line contains n distinct integer numbers p_1, p_2, ... p_{n}, separated by single spaces (1 ≤ p_{i} ≤ 10000), where p_{i} stands for the price offered by the i-th bidder.


-----Output-----

The single output line should contain two integers: index of the winner and the price he will pay. Indices are 1-based.


-----Examples-----
Input
2
5 7

Output
2 5

Input
3
10 2 8

Output
1 8

Input
6
3 8 2 9 4 14

Output
6 9

Difficulty: interview

Starter code:

Solutions:
n=int(input())

L=list(map(int,input().split()))

ind=L.index(max(L))

L.remove(max(L))

x=max(L)

print(ind+1,x)


n=int(input())
a=list(map(int,input().split()))
if a[0]>a[1]:
    i=0
    j=1
else:
    j=0
    i=1
for k in range(2,n):
    if a[k]>a[i]:
        j=i
        i=k
    elif a[k]>a[j]:
        j=k
print(i+1,a[j])

n = int(input())
prices = list(map(int, input().split()))
pr = max(prices)
ind = prices.index(pr)
prices.remove(pr)
spesa = max(prices)
print(ind+1, spesa)


__author__ = 'asmn'

n = int(input())
a = sorted(enumerate(map(int, input().split())),key=lambda x:-x[1])

print(a[0][0]+1, a[1][1])



n = int(input())
prices = [int(i) for i in input().split()]
people = []
for i in range(n): people.append([i+1, prices[i]])
people.sort(key=lambda x: x[1])
print(str(people[-1][0])+' '+str(people[-2][1]))



__author__ = 'Administrator'
n = int(input())
test = []
test1 = []
test = list(map(int, input().split()))
i = 1
for value in test:
    test1.append((value, i))
    i += 1

test1.sort(key=lambda d: d[0], reverse=True)

print(test1[0][1], test1[1][0])

n = int(input())
prices = list(map(int,input().split()))

winner = prices.index(max(prices)) + 1

prices.pop(prices.index(max(prices)))
money = max(prices)
print(winner,money)

n = int(input())
p = list(map(int,input().split()))
ll = p.index(max(p))
p.pop(ll)
print(ll+1,max(p))


'''
    CodeForces problem 386A
    26/01/2014
'''

# (x, y) = (offerta, tizio)
n = int( input() )
l = [ int(x) for x in input().split()]
i=1
off = []
for x in l:
    off.append( (x, i) )
    i+=1
    
off.sort( reverse=True )    

print(str(off[0][1])+' '+str(off[1][0]))


n = int(input())
v = list(map(int, input().split()))

ret = max(v)
idx = v.index(ret)
v[idx] = -1
ret = max(v)

print(str(idx + 1) + ' ' + str(ret))


input()
bet = [int(i) for i in input().split()]
x = bet.index(max(bet)) + 1
bet.sort()
print(x, bet[-2])

input()
p = list(enumerate(map(int, input().split()), 1))
p.sort(key = lambda i: i[1])
print(p[-1][0], p[-2][1])

n = int(input())
prs = [int(x) for x in input().split()]

print(prs.index(max(prs))+1, sorted(prs)[-2])

n = int(input())
prices = [int(x) for x in input().split()]

idx = 0
max_price = prices[0]
pay = 0
for i in range (1, n):
	if prices[i] > max_price:
		pay = max_price
		max_price = prices[i]
		idx = i
	elif prices[i] > pay:
		pay = prices[i]

print(str(idx+1) + " " + str(pay))

n = int(input())
a = list(input().split())
mx = -1
mx2 = -1
pos = -1
for i in range(0, n):
	a[i] = int(a[i])
	if(a[i] > mx):
		mx2 = mx
		pos = i + 1
		mx = a[i]
	elif(a[i] > mx2):
		mx2 = a[i]
	i = i + 1
print(str(pos) + ' ' + str(mx2))

n = int(input())
a = list(map(int, input().split()))
p = a.index(max(a))
a.pop(p)
print(p+1, max(a))

import sys
import math

n = int(sys.stdin.readline())
pn = [int(x) for x in (sys.stdin.readline()).split()]

vmax = 0
rmax = 0
ind = 0
for i in range(n):
    if(pn[i] > vmax):
        rmax = vmax
        vmax = pn[i]
        ind = i + 1    
    elif(pn[i] > rmax):
        rmax = pn[i]
        
print(ind, rmax)


    



n = int(input())
a = list(map(int, input().split()))
print(a.index(max(a)) + 1, max(a[ : a.index(max(a))] + a[a.index(max(a)) + 1 :]))

n, p = int(input()), sorted((x, i) for i, x in enumerate(map(int, input().split())))
print(p[-1][1] + 1, p[-2][0])

read = lambda: list(map(int, input().split()))
n = int(input())
p = list(read())
Max = max(p)
ind = p.index(Max) + 1
p.remove(Max)
Max2 = max(p)
print(ind, Max2)



a = int(input())
max_n = 0
max_1 = 0
max_2 = 0
k = 0
b = [int(i) for i in input().split()]
for i in range(len(b)):
    if max(b[i], max_n) > max_n:
        max_1 = max_n
        k = i + 1
        max_n = max(b[i], max_n)
dp = [i for i in range(len(b))]
dp.reverse()
max_n = 0
for i in dp:
    if max(b[i], max_n) > max_n:
        max_2 = max_n
        k = i + 1
        max_n = max(b[i], max_n)
print(str(k) + " " + str(max(max_1, max_2)))


n = int(input())
p = list(map(int,input().split()))
ll = p.index(max(p))
p.pop(ll)
print(ll+1,max(p))

n = int(input())
p = list(map(int, input().split()))

a = p.index(max(p)) + 1
p.remove(max(p))
b = max(p)

print(a, b)

def second_maximum(lst):
    b = list()
    for i in range(len(lst)):
        b.append(tuple([lst[i], i + 1]))
    d = sorted(b, key=lambda x: x[0])
    return d[len(d) - 1][1], d[len(d) - 2][0]


n = int(input())
a = [int(i) for i in input().split()]
print(*second_maximum(a))


# Made By Mostafa_Khaled 
bot = True 
n = int(input())

p = list(map(int,input().split()))

ll = p.index(max(p))

p.pop(ll)

print(ll+1,max(p))

# Made By Mostafa_Khaled