#include <bits/stdc++.h>

#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,tune=native")
using namespace std;

typedef int ll;
typedef long double ld;

#define ff first
#define ss second
#define pb push_back
#define el "\n"
#define se " "

const ll N=1e5+9;
const ll INF=1e18;

ll n,m,a,b,c,d,k,kk,i,j,cnt,cnt1,res,res1,sum,sum1,val,cur;

int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(i=1;i<=n;i++){
        cin>>a;
    }
    cout<<n-1<<el;
    for(i=1;i<n;i++){
        cout<<i<<se<<i+1<<el;
    }
}
