Problem: Petya has got 2n cards, each card contains some integer. The numbers on the cards can be the same. Let's index all cards by consecutive integers from 1 to 2n. We'll denote the number that is written on a card with number i, as ai. In order to play one entertaining game with his friends, Petya needs to split the cards into pairs so that each pair had equal numbers on the cards. Help Petya do that.

Input

The first line contains integer n (1 ≤ n ≤ 3·105). The second line contains the sequence of 2n positive integers a1, a2, ..., a2n (1 ≤ ai ≤ 5000) — the numbers that are written on the cards. The numbers on the line are separated by single spaces.

Output

If it is impossible to divide the cards into pairs so that cards in each pair had the same numbers, print on a single line integer -1. But if the required partition exists, then print n pairs of integers, a pair per line — the indices of the cards that form the pairs.

Separate the numbers on the lines by spaces. You can print the pairs and the numbers in the pairs in any order. If there are multiple solutions, print any of them.

Examples

Input

3
20 30 10 30 20 10


Output

4 2
1 5
6 3


Input

1
1 2


Output

-1

Solution (in JAVA):

Solution:
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author ogiekako
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream;
		try {
			inputStream = new FileInputStream("input.txt");
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		OutputStream outputStream;
		try {
			outputStream = new FileOutputStream("output.txt");
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		MyScanner in = new MyScanner(inputStream);
		MyPrintWriter out = new MyPrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, MyScanner in, MyPrintWriter out) {
        int n = in.nextInt();
        int[] first = new int[n];
        int[] second = new int[n];
        int[] last = new int[5001];
        int ptr = 0;
        for (int i = 0; i < n * 2; i++){
            int k = in.nextInt();
            if(last[k]==0){
                last[k] = i + 1;
            }else{
                first[ptr] = last[k];
                second[ptr++] = i + 1;
                last[k] = 0;
            }
        }
        if(ptr != n){
            out.println(-1);
            return;
        }
        for (int i = 0; i < n; i++){
            out.println(first[i], second[i]);
        }
    }
}

class MyScanner {
    private final InputStream in;

    public MyScanner(InputStream in) {
        this.in = in;
    }

    int bufLen;
    int bufPtr;
    byte[] buf = new byte[1024];

    public int read() {
        if (bufLen == -1)
            throw new InputMismatchException();
        if (bufPtr >= bufLen) {
            bufPtr = 0;
            try {
                bufLen = in.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (bufLen <= 0)
                return -1;
        }
        return buf[bufPtr++];
    }

    public String nextLine() {
        try {
            StringBuilder res = new StringBuilder("");
            int c = read();
            if (c == -1) return null;
            while (c == '\n' || c == '\r') {
                c = read();
                if (c == -1) return null;
            }
            do {
                res.append((char) c);
                c = read();
            } while (c != '\n' && c != '\r');
            return res.toString();
        } catch (Exception e) {
            throw new NoSuchElementException();
        }
    }

    public char nextChar() {
        try {
            int c = read();
            if (c == -1) return (char) c;
            while (Character.isWhitespace(c)) {
                c = read();
                if (c == -1) return (char) c;
            }
            return (char) c;
        } catch (Exception e) {
            return (char) -1;
        }
    }

    private char[] strBuf = new char[65536];

    public String next() {
        int strLen = 0;
        int c;
        do {
            c = read();
            if (c == -1) throw new NoSuchElementException();
        } while (Character.isWhitespace(c));
        do {
            if (strLen + 1 >= strBuf.length) {
                char[] tmp = new char[strBuf.length * 2];
                System.arraycopy(strBuf, 0, tmp, 0, strBuf.length);
                strBuf = tmp;
            }
            strBuf[strLen++] = (char) c;
            c = read();
        } while (c != -1 && !Character.isWhitespace(c));
        return new String(strBuf, 0, strLen);

    }

    public int nextInt() {
        try {
            int c = read();
            if (c == -1) return c;
            while (c != '-' && (c < '0' || '9' < c)) {
                c = read();
                if (c == -1) return c;
            }
            if (c == '-') return -nextInt();
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while ('0' <= c && c <= '9');
            return res;
        } catch (Exception e) {
            return -1;
        }
    }

    public long nextLong() {
        try {
            int c = read();
            if (c == -1) return c;
            while (c != '-' && (c < '0' || '9' < c)) {
                c = read();
                if (c == -1) return c;
            }
            if (c == '-') return -nextLong();
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while ('0' <= c && c <= '9');
            return res;
        } catch (Exception e) {
            return -1;
        }
    }

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

    public int[] nextIntArray(int n) {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) res[i] = nextInt();
        return res;
    }

    public int[][] nextIntField(int height, int width) {
        int[][] res = new int[height][width];
        for (int i = 0; i < height; i++) for (int j = 0; j < width; j++) res[i][j] = nextInt();
        return res;
    }

    public long[] nextLongArray(int n) {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) res[i] = nextLong();
        return res;
    }

    public long[][] nextLongArray(int n1, int n2) {
        long[][] res = new long[n1][n2];
        for (int i = 0; i < n1; i++)
            for (int j = 0; j < n2; j++) {
                res[i][j] = nextLong();
            }
        return res;
    }

    public String[] nextStringArray(int n) {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) res[i] = next();
        return res;
    }


    public void readArrays(int[]... arrays) {
        for (int i = 0; i < arrays[0].length; i++) for (int j = 0; j < arrays.length; j++) arrays[j][i] = nextInt();
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }

    public int[] nextIntArray() {
        int n = nextInt();
        return nextIntArray(n);
    }
}

class MyPrintWriter {
    PrintWriter out;

    public MyPrintWriter(OutputStream outputStream) {
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public MyPrintWriter(Writer writer) {
        out = new PrintWriter(writer);
    }

    public void debug(Object... os) {
        println("dbg : " + Arrays.deepToString(os));
    }

    public void println(Object... os) {
        for (int i = 0; i < os.length - 1; i++) {
            out.print(os[i]);
            out.print(' ');
        }
        out.println(os[os.length - 1]);
    }

    public void close() {
        out.close();
    }

    public void flush() {
        out.flush();
    }
}