
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#define INF 0x3f3f3f3f

using namespace std;
const int maxn=55;
int N,a[maxn];

int main(){
	scanf("%d",&N);
	int t_min=INF,t_max=-INF;
	int pos_min=1;
	int pos_max=1;
	for (int i=1;i<=N;i++)
		scanf("%d",&a[i]);
	for (int i=1;i<=N;i++){
		if (a[i]<t_min)
			t_min=a[i],pos_min=i;
		if (a[i]>t_max)
			t_max=a[i],pos_max=i;
	}
	printf("%d\n",N*2-2);
	if (abs(t_min)<=abs(t_max)){
		for (int i=1;i<=N;i++){
			if (i==pos_max)
				continue;
			printf("%d %d\n",pos_max,i);
		}
		for (int i=2;i<=N;i++)
			printf("%d %d\n",i-1,i);
	}else{
		for (int i=1;i<=N;i++){
			if (i==pos_min)
				continue;
			printf("%d %d\n",pos_min,i);
		}
		for (int i=N-1;i>=1;i--)
			printf("%d %d\n",i+1,i);
	}
	return 0;
}

