i,j,s,t,a[110],b[20000]; main(n){ for(scanf("%d",&n);ia[j]){ b[s++]=j-1; b[s++]=j; a[j-1]^=a[j]^=a[j-1]^=a[j]; } printf("%d\n",s/2); for(i=0;b[i];i+=2)printf("%d %d\n",b[i],b[i+1]); fflush(0); gets(&n); return 0; }