/* Bogdan Iordache
 * O(N)
 */
#include <bits/stdc++.h>
using namespace std;
 
long long modul(long long x) { return x > 0 ? x : -x; }
 
int main() {
#ifndef LOCAL
    ifstream cin("tri.in");
    ofstream cout("tri.out");
#endif
 
    int n;
    assert(cin >> n);
    assert(3 <= n && n <= 100000);
 
    vector<int> v;
    int x;
    v.reserve(n);
    while (cin >> x) {
        v.push_back(x);
        assert(0 <= x <= 999999999);
    }
    assert((int)v.size() == n);
 
    int last1 = -1, last2 = -1;
    long long last_sum = 0, current_sum = 0, best = (1LL << 62), bestl, bestr;
    for (int i = 0; i < n; ++i) {
        if (v[i] % 2) {
            if (last1 != -1) {
                if (best >= modul(current_sum - last_sum)) {
                    best = modul(current_sum - last_sum);
                    bestl = last1;
                    bestr = i;
                }
            }
            last1 = last2;
            last2 = i;
            last_sum = current_sum;
            current_sum = 0;
        } else
            current_sum += v[i];
    }
 
    cout << bestl + 1 << ' ' << bestr + 1 << '\n';
 
    return 0;
}