#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
int n;

int main()
{
    scanf("%d",&n);
    int maxx=0,ind=-1;
    for(int i=1;i<=n;i++)
    {
        int num;scanf("%d",&num);
        if(abs(num)>abs(maxx))
            ind=i,maxx=num;
    }
    if(ind==-1)
    {
        cout<<0<<endl;
        return 0;
    }
    cout<<2*n-1<<endl;
    for(int i=1;i<=n;i++)
        cout<<ind<<" "<<i<<endl;
    if(maxx>0)
        for(int i=1;i<n;i++)
            cout<<i<<" "<<i+1<<endl;
    else
        for(int i=n;i>1;i--)
            cout<<i<<" "<<i-1<<endl;
    return 0;
}
