Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.

The robber girl was angry at first, but then she decided to arrange the animals herself. She repeatedly names numbers l and r such that r - l + 1 is even. After that animals that occupy positions between l and r inclusively are rearranged as follows: the animal at position l swaps places with the animal at position l + 1, the animal l + 2 swaps with the animal l + 3, ..., finally, the animal at position r - 1 swaps with the animal r.

Help the robber girl to arrange the animals in the order of non-decreasing height. You should name at most 20 000 segments, since otherwise the robber girl will become bored and will start scaring the animals again.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo.

The second line contains n space-separated integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^9), where a_{i} is the height of the animal occupying the i-th place.


-----Output-----

Print the sequence of operations that will rearrange the animals by non-decreasing height.

The output should contain several lines, i-th of the lines should contain two space-separated integers l_{i} and r_{i} (1 ≤ l_{i} < r_{i} ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the order the operations are performed.

The number of operations should not exceed 20 000.

If the animals are arranged correctly from the start, you are allowed to output nothing.


-----Examples-----
Input
4
2 1 4 3

Output
1 4

Input
7
36 28 57 39 66 69 68

Output
1 4
6 7

Input
5
1 2 1 2 1

Output
2 5
3 4
1 4
1 4



-----Note-----

Note that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed.

Difficulty: interview

Starter code:

Solutions:
def s(arr):
    arr2 = arr[:]
    arr2.sort()
    return arr == arr2

x = int(input())
y = list(map(int, input().split(' ')))
while (not s(y)):
    for i in range(x-1):
        if y[i] > y[i+1]:
            print(i+1, i+2)
            y[i], y[i+1] = y[i+1], y[i]
    


n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	for j in range(n - 1):
		if (arr[j] > arr[j + 1]):
			arr[j], arr[j+1] = arr[j+1], arr[j]
			print(j + 1, j + 1 + 1)

n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    for j in range(n - 1, i, -1):
        if a[j] < a[j - 1]:
            a[j], a[j - 1] = a[j - 1], a[j]
            print(j, j + 1)



n = int(input())
l = list(map(int, input().split()))

cmd = []
for i in range(n + 2):
	for j in range(n - 1):
		if l[j] > l[j + 1]:
			cmd.append([j + 1, j + 2])
			l[j], l[j + 1] = l[j + 1], l[j]
for x in cmd:
	print(*x)

n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    for j in range(n-1):
        if a[j+1]<a[j]:
            a[j],a[j+1] = a[j+1],a[j]
            print(j+1,j+2)


import sys
n=int(input())
z=list(map(int,input().split()))
now=[0,0]
for i in range(n):
    for j in range(n-i-1):
        if z[j]>z[j+1]:
            print(j+1, j+2)
            z[j],z[j+1]=z[j+1],z[j]

n = int(input())
a = list(map(int, input().split()))

swaps = []
for i in range(n):
    # find the value at element i
    smallest = a[i]
    best_pos = i
    for j in range(i + 1, n):
        if a[j] < smallest:
            smallest = a[j]
            best_pos = j
    # swap from i to j
    while best_pos > i:
        a[best_pos - 1], a[best_pos] = a[best_pos], a[best_pos - 1]
        swaps.append((best_pos, best_pos + 1))
        best_pos -= 1

for a, b in swaps:
    print(a, b)


n = int(input())
c = list(map(int, input().split()))
while True:
    f = False
    for i in range(1, n):
        if c[i] < c[i-1]:
            f = True
            c[i], c[i-1] = c[i-1], c[i]
            print(i, i+1)
    if not f:
        break


n = int(input())
s = list(map(int, input().split()))
for i in range(n):
    for j in range(n - i - 1):
        if s[j] > s[j + 1]:
            print(j + 1, j + 2)
            s[j], s[j + 1] = s[j + 1], s[j]


read = lambda: list(map(int, input().split()))
n = int(input())
a = list(read())
for i in range(n):
    for j in range(n - 1):
        if a[j] > a[j + 1]:
            print(j + 1, j + 2)
            a[j], a[j + 1] = a[j + 1], a[j]


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    for j in range(n - i - 1):
        if a[j] > a[j + 1]:
            a[j], a[j + 1] = a[j + 1], a[j]
            print(j + 1, j + 2)

import sys


def main():
    n = int(sys.stdin.readline())
    x = list(map(int, sys.stdin.readline().split()))
    
    found = True
    while found:
        found = False
        for i in range(1,n):
            if x[i]<x[i-1]:
                found = True
                print(i,i+1)
                x[i-1],x[i] = x[i],x[i-1]
    

main()


n = int(input())
a = list(map(int, input().split()))

for i in reversed(list(range(len(a)))):
    for j in range(1, i + 1):
        if a[j - 1] > a[j]:
            a[j], a[j - 1] = a[j - 1], a[j]
            print(j, j + 1)


def main():
    n = int(input())
    a = list(map(int, input().split()))
    for i in range(len(a)):
        for j in range(len(a) - 1):
            if a[j] > a[j + 1]:
                print(j + 1, j + 2)
                a[j], a[j + 1] = a[j + 1], a[j]



def __starting_point():
    main()

__starting_point()

n = int(input())
tab = list(map(int, input().split()))

for i in range(n):
    for j in range(n - 1):
        if tab[j] > tab[j + 1]:
            tab[j], tab[j + 1] = tab[j + 1], tab[j]
            print(str(j + 1) + " " + str(j + 2))


input()
a = list(map(int, input().split()))

def bubble_sort(a):
    for i in reversed(range(len(a))):
        for j in range(1, i + 1):
            if a[j-1] > a[j]:
                print(j, j + 1)
                a[j], a[j-1] = a[j-1], a[j]

bubble_sort(a)

n = int(input())
amount = 0
a = list(map(int, input().split()))
for i in range(n):
    for j in range(1, n):
        if a[j] < a[j - 1]:
            print(j, j + 1)
            amount += 1
            a[j], a[j - 1] = a[j - 1], a[j]
#print(amount, a)


n = int(input())
arr = list(map(int, input().split()))
'''s = sorted(arr)
for i in range(n):
    ind = arr.index(s[i])
    for j in range(min(i, ind), max(i, ind)):
        print(j + 1, j + 2)
    arr = [arr[ind]] + arr[:ind] + arr[ind + 1:]'''
for i in range(n):
    minn = 10000000000
    ind = -1
    for j in range(i, n):
        if arr[j] < minn:
            minn = arr[j]
            ind = j
    arr = arr[:i] + [arr[ind]] + arr[i:ind] + arr[ind+1:]
    for j in range(ind - 1, i - 1, -1):
        print(j + 1, j + 2)


n = int(input())
l = list(map(int, input().split()))
while l != list(sorted(l)):
    for i in range(len(l)-1):
        if l[i] > l[i+1]:
            temp = l[i]
            l[i] = l[i+1]
            l[i+1] = temp
            print(i+1, i+2)


n = int(input())
arr = [int(x) for x in input().split()]
while True:
    suc = 0
    for i in range(1,n):
        if(arr[i-1]>arr[i]):
            arr[i-1],arr[i] = arr[i],arr[i-1]
            print(i,i+1)
            suc = 1
    if(suc==0):
        break

n = int(input())
L = list(map(int, input().split()))

for i in range(1, n):
    for j in range(n - i):
        if L[j] > L[j + 1]:
            (L[j], L[j + 1]) = (L[j + 1], L[j])
            print(j + 1, j + 2)


n = int(input())
a = [int(s) for s in input().split()]
for j in range(n):
    k = 0
    i = 0
    while i < n-1:
        if a[i] > a[i+1]:
            k += 1
            tmp = a[i]
            a[i] = a[i+1]
            a[i+1] = tmp
            print(i+1, i+2)
        i += 2
    i = 1
    while i < n-1:
        if a[i] > a[i+1]:
            k += 1
            tmp = a[i]
            a[i] = a[i+1]
            a[i+1] = tmp
            print(i+1, i+2)
        i += 2
    if k == 0:
        break


n=int(input())
tailles=list(map(int,input().split()))
a=1
while a!=-1:
	a=-1
	b=-1
	
	i=0
	while i!=n-1 and tailles[i+1]>=tailles[i]:
		i+=1
	
	if i!=n-1:
		a=1
		print(i+1,i+2)
		
		tailles[i],tailles[i+1]=tailles[i+1],tailles[i]