n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a.append('')
i = 1
while i < n+1:
    ind = a.index(max(a[:-(i):]))
    a[ind:-(i):] = reversed(a[ind:-(i):])
    if ind+1 != len(a)-i:
        print(ind+1,len(a)-i)
    i += 1

