#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int N;
    cin >> N;

    long long a[50];
    long long max=-1000001,min=1000001;
    int imax=0,imin=0;

    for(int i=0;i<N;i++){
        cin >> a[i];
        if(a[i]>max){ max=a[i]; imax=i+1; }
        if(a[i]<min){ min=a[i]; imin=i+1; }
    }

    if(min>=0){
        cout << (N-1) << endl;
        for(int i=1;i<=N-1;i++) cout << i << ' ' << (i+1) << endl;
    }else if(max<=0){
        cout << (N-1) << endl;
        for(int i=N-1;i>=1;i--) cout << (i+1) << ' ' << i << endl;
    }else if(max>=-min){
        cout << (2*N-1) << endl;
        for(int i=1;i<=N;i++) cout << imax << ' ' << i << endl;
        for(int i=1;i<=N-1;i++) cout << i << ' ' << (i+1) << endl;        
    }else{
        cout << (2*N-1) << endl;
        for(int i=1;i<=N;i++) cout << imin << ' ' << i << endl;
        for(int i=N-1;i>=1;i--) cout << (i+1) << ' ' << i << endl;
    }

    return 0;
}