import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int N = sc.nextInt(); int[] A = new int[N]; for (int i = 0; i < N; ++i) { A[i] = sc.nextInt(); } for (int i = 0; i < N; ++i) { int idx = -1; int min = 999; for (int j = i; j < N; ++j) { if (A[j] < min) { min = A[j]; idx = j; } } if (idx != i) { System.out.println(idx + " " + i); A[idx] = A[i]; A[i] = min; } } System.out.flush(); sc.next(); } }