import java.util.Scanner; public class Main { static StringBuilder sb; public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int[]A = new int[N]; for(int i = 0; i < N; i++) { A[i] = scan.nextInt(); } sb = new StringBuilder(); bubbleSort(A, N); System.out.print(sb.toString()); int Dummy = scan.nextInt(); scan.close(); if(Dummy == -1) { System.exit(0); } } static void bubbleSort(int[]A, int n) { boolean flag = true; while(flag) { flag = false; for(int i = n - 1; i >= 1; i--) { if(A[i] < A[i - 1]) { int t = A[i]; A[i] = A[i - 1]; A[i - 1] = t; flag = true; sb.append(i).append(" ").append(i-1); sb.append("\n"); } } } } }