#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <numeric>
#include <climits>
#include <math.h>
#include <memory.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for(int i = (k); i < (int)(n); i++)
using namespace std;
using ll = long long;
int N, M;
int cnt = 0;
int ans = 0;
int tmp;
int main(){
    int N;
    cin >> N;
    int a[N];
    int maxindex = 0;
    int absmax = -1;
    rep(i, N) cin >> a[i];
    rep(i, N){
        if(abs(absmax) < abs(a[i])){
            absmax = a[i];
            maxindex = i;
        }
    }
    cout << 2 * N - 1 << endl;
    rep(i, N) cout << maxindex + 1 << " " << i + 1 << endl;
    rep(i, N - 1){
        if(absmax < 0) cout << N - i << " " << N - i - 1 << endl;
        else cout << i + 1 << " " << i + 2 << endl;
    }
    return 0;
}