Problem: 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.

Solution (in JAVA):

Solution:
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    private static boolean IS_MULTI_PROBLEM = false;

    public static void main(String[] args) {
        Scanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        Solver solver = new Solver(in, out);

        for (int i = 0, n = IS_MULTI_PROBLEM ? in.nextInt() : 1; i < n; i++) {
            solver.solve();
        }

        out.flush();
    }
}

class Solver {
    private Scanner in;
    private PrintWriter out;

    Solver(Scanner in, PrintWriter out) {
        this.in = in;
        this.out = out;
    }

    void solve() {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = in.nextInt();
        while (true) {
            for (int i = 0; i < n; i++) {
                int j = i + 1;
                boolean swap = false;
                for (; j < n; j += 2) {
                    if (a[j - 1] > a[j]) swap = true;
                    else break;
                }
                if (swap) {
                    j -= 2;
                    for (int k = i; k < j; k += 2) {
                        int tmp = a[k];
                        a[k] = a[k + 1];
                        a[k + 1] = tmp;
                    }
                    out.println((i + 1) + " " + (j + 1));
                    break;
                }
                if (i == n - 1) return;
            }
        }
    }
}

interface Scanner {
    boolean hasNext();
    String next();
    long nextLong();
    int nextInt();
    double nextDouble();
}

class FastScanner implements Scanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}

    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}

    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}

    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() { return Double.parseDouble(next());}
}

class UnionFind {
    int[] data;

    UnionFind(int size) {
        data = new int[size];
        Arrays.fill(data, -1);
    }

    boolean merge(int x, int y) {
        x = getRoot(x);
        y = getRoot(y);
        if (x != y) {
            if (data[y] < data[x]) {
                int t = x;
                x = y;
                y = t;
            }
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }

    boolean bothSameRoot(int x, int y) {
        return getRoot(x) == getRoot(y);
    }

    int getRoot(int x) {
        return data[x] < 0 ? x : (data[x] = getRoot(data[x]));
    }

    int getSize(int x) {
        return -data[getRoot(x)];
    }
}