n = int(input()) a = list(map(int, input().split())) ans = [] for i in range(n): min_j = i for j in range(i, n): if a[j] < a[min_j]: min_j = j if i != min_j: ans.append(f"{i} {min_j}") print(len(ans)) print(*ans, sep="\n")