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 a1, a2, ..., an (1 ≤ ai ≤ 109), where ai 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 li and ri (1 ≤ li < ri ≤ 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.
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class B 
{
    public static void main(String[] args)
    {
        new B().solve();
    }

    FasterScanner in=new FasterScanner();
    PrintWriter out=new PrintWriter(System.out);

    long mod = (long)1e9 + 7;
    public void solve()
    {
//    	int tt=in.nextInt();
//    	for(int ii=0;ii<tt;ii++)
    	{
    		int n=in.nextInt();
    		int[] pos = new int[n];
    		s[] arr1 = new s[n];
    		s[] arr = new s[n];
    		for(int i=0;i<n;i++) {
    			arr[i]=new s(i,in.nextInt());
    			arr1[i]= new s(i,arr[i].val);
    		}
    		Arrays.sort(arr);
    		for(int i=0;i<n;i++){
    			pos[i] = arr[i].idx;
    			arr1[arr[i].idx].pos=i;
    		}
//    		for(int i=0;i<n;i++) {
//    			arr1[i].idx;
//    		}
//    		System.out.println(Arrays.toString(pos));
    		for(int i=0;i<n;i++) {
    		//	System.out.println(Arrays.toString(pos));
    			int  x = pos[i];
    			if(x!=i) {
    				while(x!=i){
//    					System.out.println(x);
    					out.println(x+" "+(x+1));
//    					System.out.println(arr1[x-1].pos +" "+arr1[x].pos);
    					arr1[x] = arr1[x-1];
    					arr1[x-1] = arr[i];
//    					System.out.println(arr1[x-1].pos);
    					pos[arr1[x].pos] = x;
    					x--;
    				}
    			}
    		}
    	}
    	out.close();
    }
    
    class s implements Comparable<s>
    {
    	int idx;
    	int val;
    	int pos;
    	public s(int i,int v) {
    		this.idx=i;
    		this.val=v;
    	}
		@Override
		public int compareTo(s o) {
			// TODO Auto-generated method stub
			if(this.val!=o.val) {
				return Integer.compare(this.val,o.val);
			}
			else
			{
				return Integer.compare(this.idx, o.idx);
			}
		}
    }
    
    int[][] arr;
    boolean[][] visited;
    int cur=1;
    int temp=0;
    int ans=0;
    int n,m;
    
    void dfs(int i, int j)
    {
    	if(visited[i][j])
    		return;
    	visited[i][j] = true;
    	
    }
    
    class Node
    {
    	int x,y;
    	public Node(int x,int y) {
    		this.x = x;
    		this.y = y;
    	}
    	ArrayList<Node> list = new ArrayList<>();
    }
    
    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }
        private boolean isEndOfLine(int c) {
            return c=='\n' || c=='\r' || c==-1;
        }
        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
        private boolean isSpaceChar(int c) {
            return c=='\n' || c=='\r' || c==-1 || c==' ' || c=='\t';
        }
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
        public double nextDouble()
        {
            return Double.parseDouble(nextString());
        }
        public int[] nextIntArray(int n)
        {
            int[] arr=new int[n];
            for(int i=0;i<n;i++)
            {
                arr[i]=nextInt();
            }
            return arr;
        }
        public long[] nextLongArray(int n)
        {
            long[] arr=new long[n];
            for(int i=0;i<n;i++)
            {
                arr[i]=nextLong();
            }
            return arr;
        }
        public int[] nextIntArray10(int n)
        {
            int[] arr=new int[n+1];
            for(int i=1;i<=n;i++)
            {
                arr[i]=nextInt();
            }
            return arr;
        }
        public long[] nextLongArray10(int n)
        {
            long[] arr=new long[n+1];
            for(int i=1;i<=n;i++)
            {
                arr[i]=nextLong();
            }
            return arr;
        }
        public int[] nextIntArray11(int n)
        {
            int[] arr=new int[n+2];
            for(int i=1;i<=n;i++)
            {
                arr[i]=nextInt();
            }
            return arr;
        }
        public long[] nextLongArray11(int n)
        {
            long[] arr=new long[n+2];
            for(int i=1;i<=n;i++)
            {
                arr[i]=nextLong();
            }
            return arr;
        }
    }

}