#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool compare(pair<int, string> p1, pair<int, string> p2) {
return p1.first > p2.first;
}
int main() {
int n;
cin >> n;
vector<pair<int, string>> candidates;
for (int i = 0; i < n; i++) {
string votes;
cin >> votes;
candidates.push_back(make_pair(stoi(votes), to_string(i + 1)));
}
sort(candidates.begin(), candidates.end(), compare);
cout << candidates[0].second << endl;
cout << candidates[0].first << endl;
}