#include <bits/stdc++.h>
using namespace std;
const long long INF = 123456789;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i, r, n) for (ll i = (ll)(n - 1); i >= r; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll>> vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl

/*--------------------template--------------------*/

int main()
{
    vp vpp;
    cin >> n;
    vi v(n);
    REP(i, n)
    {
        cin >> v[i];
    }
    REP(i, n)
    {
        ll a = abs(v[i]);
        if (a > sum) {
            sum = a;
            cnt = i;
        }
    }

    bool f = true;
    REP(i, v.size() - 1)
    {
        if (v[i] > v[i + 1]) {
            f = false;
        }
    }
    if (f) {
        cout << 0 << endl;
        return 0;
    }

    if (v[cnt] > 0) {
        REP(i, v.size() - 1)
        {
            while (1) {
                if (v[i] > v[i + 1]) {
                    ll b = v[i] - v[i + 1];
                    ll cn = 0;
                    k = INF;
                    REP(i, n)
                    {
                        if (v[i] >= b && k > v[i]) {
                            cn = i;
                            k = v[i];
                        }
                    }
                    if (cn == 0) {
                        v[i + 1] += v[cnt];
                        vpp.emplace_back(cnt + 1, i + 2);
                    } else {
                        v[i + 1] += v[cn];
                        vpp.emplace_back(cn + 1, i + 2);
                    }
                    ll a = abs(v[i + 1]);
                    if (a > sum) {
                        sum = a;
                        cnt = i + 1;
                    }
                } else {
                    break;
                }
            }
        }
    } else {

        for (int i = v.size() - 2; i >= 0; i--) {
            while (1) {
                if (v[i] > v[i + 1]) {
                    ll b = v[i+1] - v[i];
                    ll cn = 0;
                    k = 0;
                    REP(i, n)
                    {
                        if (v[i] <= b && k > v[i]) {
                            cn = i;
                            k = v[i];
                        }
                    }
                    if (cn == 0) {
                        v[i] += v[cnt];
                        vpp.emplace_back(cnt + 1, i + 1);
                    } else {
                        v[i] += v[cn];
                        vpp.emplace_back(cn + 1, i + 1);
                    }
                    ll a = abs(v[i]);
                    if (a > sum) {
                        sum = a;
                        cnt = i;
                    }
                } else {
                    break;
                }
            }
        }
    }

    cout << vpp.size() << endl;
    REP(i, vpp.size())
    {
        cout << vpp[i].first << ' ' << vpp[i].second << endl;
    }
}

Measured memory_bytes: 256