#include <iostream>
using namespace std;
#include<string.h>
#include<set>
#include<stdio.h>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#include <cstdio>
#include <cstdlib>
#include<stack>
#include<vector>
int a[100];
int main()
{
    int n;
    cin>>n;
    int max1=-1e8;
    int t1,t2;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
        if(max1<abs(a[i]))
        {
            max1=abs(a[i]);
            t1=i;
        }
    }
    cout<<2*n-1<<endl;
    for(int i=1;i<=n;i++)
        cout<<t1<<" "<<i<<endl;
    if(a[t1]>=0)
    {
        for(int i=2;i<=n;i++)
            cout<<i-1<<" "<<i<<endl;
    }
    else
    {
        for(int i=n-1;i>=1;i--)
            cout<<i+1<<" "<<i<<endl;
    }
    return 0;
}
