#pragma comment(linker, "/STACK:102400000,102400000")
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <vector>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <sstream>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
#define Key_Value ch[ch[root][1]][0]
#define DBN1(a)           cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)         cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)       cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)     cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e)   cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"
#define DBN6(a,b,c,d,e,f) cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<", "<<#f<<"="<<(f)<<"\n"
#define clr(a,x) memset(a,x,sizeof(a))
using namespace std;
typedef long long ll;
const int maxn=200000+5;
const int INF=0x7fffffff;
const int P=1000000007;
const double PI=acos(-1.0);
template<typename T>
inline T read(T&x){
    x=0;int _f=0;char ch=getchar();
    while(ch<'0'||ch>'9')_f|=(ch=='-'),ch=getchar();
    while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
    return x=_f?-x:x;
}
template <class T1, class T2>inline void gmax(T1 &a,T2 b){if (b>a) a=b;}
template <class T1, class T2>inline void gmin(T1 &a,T2 b){if (b<a) a=b;}
/*ll primes[maxn+5],d[maxn+5];
void init(){
    for (int i=2;i<=maxn;i++){
        if(!primes[i]) primes[++primes[0]]=i;
        for (ll j=1;j<=primes[0] && i*primes[j]<=maxn;j++){
            primes[i*primes[j]]=1;
            if (i%primes[j]==0) break;
        }
    }
}
void dfs(int cur,ll now,ll num,bool flag,ll &ans){
    if (cur>d[0]) return;
    dfs(cur+1,now,num,flag,ans);
    ll n=now*d[cur];
    if (flag) ans+=num/n;
    else ans-=num/n;
    dfs(cur+1,n,num,!flag,ans);
}
ll sum(ll x){
    ll ans=0;
    dfs(1,1,x,true,ans);
    return x-ans;
}
ll n,k;
int main(){
    init();
    read(n),read(k);
    ll tmp=n;
    for(int i=1;i<=primes[0];i++){
        if(tmp%primes[i]==0){
            d[++d[0]]=primes[i];
            while (tmp%primes[i]==0) tmp/=primes[i];
        }
        if (tmp==1) break;
    }
    ll l=1,r=n,ans;
    while(l<=r){
        ll mid=l+((r-l)>>1);
        ll temp=sum(mid);
        if(temp==k) ans=mid;
        if(temp<k) l=mid+1;
        else r=mid-1;
    }
    printf("%lld\n",ans);
    return 0;
}*/
/*int k,n;
int cnt[maxn];
int main(){
    read(n),read(k);
    for (int i=1;i<=n;i++){
        int x;read(x);
        cnt[x]++;
    }
    vector<int>vec;
    for (int i=1;i<=n;i++){
        if (cnt[i]) vec.push_back(cnt[i]);
    }
    if (vec.size()<=k) puts("0");
    else{
        sort(vec.begin(),vec.end());
        int tmp=vec.size()-k;
        int ans=0;
        for (int i=0;i<tmp;i++) ans+=vec[i];
        cout<<ans<<endl;
    }
    return 0;
}*/
int n;
int main(){
    read(n);
    int mn=1e6+5,mx=-1e6-5,pos1,pos2;
    for (int i=1;i<=n;i++){
        int x;read(x);
        if (mn>x){
            mn=x;
            pos1=i;
        }
        if (mx<x){
            mx=x;
            pos2=i;
        }
    }
    printf("%d\n",2*n-1);
    if (abs(mn)<abs(mx)){
        for (int i=1;i<=n;i++){
            printf("%d %d\n",pos2,i);
        }
        for (int i=2;i<=n;i++){
            printf("%d %d\n",i-1,i);
        }
    }
    else{
        for (int i=1;i<=n;i++){
            printf("%d %d\n",pos1,i);
        }
        for (int i=n;i>=2;i--){
            printf("%d %d\n",i,i-1);
        }
    }
    return 0;
}


Measured memory_bytes: 256