#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, y, counter = 0;
  cin >> n;
  bool flag = 1;
  int *x;
  x = new int[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (x[i] < x[j] && i != j) {
        flag = 0;
        counter++;
      }
    }
    if (flag) {
      m = i + 1;
    } else if (counter == 1)
      y = x[i];
    counter = 0;
    flag = 1;
  }
  cout << m << endl << y;
  delete[] x;
  x = 0;
  return 0;
}
