#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std;
int n,Min,Max,a[1005],t,ans,Maxid,Minid;
int main(){
	Min=100000000;Max=-100000000;
	scanf("%d",&n);
	printf("%d\n",2*n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		if(a[i]<0)
				if(Max<a[i]){
					Max=a[i];
					Maxid=i;
				}
		if(a[i]>0)
				if(Min>a[i]){
					Min=a[i];
					Minid=i;
				}
	}
	if(-Min>Max){
		for(int i=1;i<=n;i++){
			a[i]+=Min;
			printf("%d %d\n",i,Minid);
		}
		t=-1;
	}else{
		for(int i=1;i<=n;i++){
			a[i]+=Max;
			printf("%d %d\n",i,Maxid);
		}
		t=1;
	}
	ans+=n;
	for(int i=1;i<=n;i++){
		if(t==1){
			Max=-100000000;
			for(int j=0;j<n;j++){
				if(Max<a[j]){
					Max=a[j];
					Maxid=j;
				}
			}
			a[i]+=Max;
			printf("%d %d\n",i,Maxid);
		}else{
			Min=100000000;
			for(int j=0;j<n;j++){
				if(Min>a[j]){
					Min=a[j];
					Minid=j;
				}
			}
			a[i]+=Min;
			printf("%d %d\n",i,Minid);		
		}
	}
	ans+=n;
	return 0;
}
