#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(ll i=0;i<(n);++i)
#define Fr(i,n) for(long long i=1;i<=(n);++i)
#define ifr(i,n) for(long long i=(n)-1;i>=0;--i)
#define iFr(i,n) for(long long i=(n);i>0;--i)
using Graph = vector<vector<int>>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll a,ma,mi,maa,mii;
  ma=-10000000;
  mi=10000000;
  cin>>a;
  ll arr[a];
  fr(i,a){
    ll b;
    cin>>b;
    ma=max(b,ma);
    if(ma==b) maa=i+1;
    mi=min(b,mi);
    if(mi==b) mii=i+1;
    arr[i]=b;
  } 
  cout<<2*a-1<<"\n";
  if(ma+mi>0){
  fr(i,a){
    cout<<maa<<" "<<i+1<<"\n";
  }
  fr(i,a-1){
    cout<<i+1<<" "<<i+2<<"\n";
  }
  }
  if(ma+mi<=0){
  fr(i,a){
    cout<<mii<<" "<<i+1<<"\n";
  }
  ifr(i,a-1){
    cout<<i+2<<" "<<i+1<<"\n";
  }
  }
}
