n,*a=map(int,open(0).read().split());print(k:=a.index(max(a)),k)