var a:array[1..1000000]of int64; n,m,max,i:longint; begin read(n); read(a[1]); max:=a[1]; m:=1; for i:=2 to n do begin read(a[i]); if a[i]>max then begin m:=i; max:=a[i]; end; end; writeln(m); write(max); end.