#include <iostream>
using namespace std;
int main() {
int a; cin >> a;
int x, min = 2000000, max = 0;
int i = 1, imin, imax;
while(cin >> x) {
if(x < min) {
min = x;
imin = i;
}
if(x < max) {
max = x;
imax = i;
}
i++;
}
cout << imin << ' ' << imax;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICAgaW50IGE7IGNpbiA+PiBhOwogICAgaW50IHgsIG1pbiA9IDIwMDAwMDAsIG1heCA9IDA7CiAgICBpbnQgaSA9IDEsIGltaW4sIGltYXg7CiAgICB3aGlsZShjaW4gPj4geCkgewogICAgICAgICAgICBpZih4IDwgbWluKSB7CiAgICAgICAgICAgICAgIG1pbiA9IHg7CiAgICAgICAgICAgICAgIGltaW4gPSBpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmKHggPCBtYXgpIHsKICAgICAgICAgICAgICAgIG1heCA9IHg7CiAgICAgICAgICAgICAgICBpbWF4ID0gaTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpKys7CiAgICB9CiAgICBjb3V0IDw8IGltaW4gPDwgJyAnIDw8IGltYXg7Cn0K