a[110],s,i,k,b[5000]; main(j){ for(;*a-~i;)scanf("%d",a-i--); for(;++i;)for(j=1;a[++j];)a[j-1]>a[j]?b[s++]=j,a[j]^=a[j-1]^=a[j]^=a[j-1]:0; printf("%d\n",s); for(;s=b[k];)fflush(!printf("%d %d\n",b[k++]-2,b[k]-1)); }