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.*;
import java.util.*;

public class Main {
    static int[] di = {0, -1, 0, 1};
    static int[] dj = {-1, 0, 1, 0};

    static int[] di_knight = {-1, -1, -2, -2, 1, 1, 2, 2};
    static int[] dj_knight = {2, -2, -1, 1, 2, -2, -1, 1};

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public static Integer gcd(Integer a, Integer b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    // Check if String A is smaller lexicographically than String B
    public static Boolean compareStringLexicographically(String A, String B) {
        if (A == null || B == null)
            return true;

        if (B.indexOf(A) == 0)
            return true;

        for (int i = 0; i < Math.min(A.length(), B.length()); i++) {
            if (A.charAt(i) != B.charAt(i))
                return A.charAt(i) < B.charAt(i);
        }

        return A.length() < B.length();
    }

    // Read Integer
    public static Integer readInt() throws Exception {
        return Integer.parseInt(br.readLine());
    }

    // Read Integer
    public static Integer readInt(String str) throws Exception {
        return Integer.parseInt(str);
    }

    // Read Integer Array
    public static int[] readIntArray() throws Exception {
        String[] s = br.readLine().split(" ");
        int arr[] = new int[s.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = readInt(s[i]);
        }

        return arr;
    }

    // Read Integer
    public static Integer readInt(BufferedReader br) throws Exception {
        return Integer.parseInt(br.readLine());
    }

    // Read Integer Array
    public static int[] readIntArray(BufferedReader br) throws Exception {
        String[] s = br.readLine().split(" ");
        int arr[] = new int[s.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = readInt(s[i]);
        }

        return arr;
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = new FileInputStream("input.txt");
        OutputStream outputStream = new FileOutputStream("output.txt");
        BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
        PrintWriter out = new PrintWriter(new BufferedOutputStream(outputStream));
        StringBuilder sb = new StringBuilder();

        int n = readInt(br) * 2;
        int x[] = readIntArray(br);
        int arr[][] = new int[n][2];
        for (int i = 0; i < n; i++) {
            arr[i][0] = x[i];
            arr[i][1] = i + 1;
        }

        Arrays.sort(arr, (a, b) -> a[0] - b[0]);

        for (int i = 0; i < n; i += 2) {
            if (arr[i][0] != arr[i + 1][0]) {
                out.println(-1);
                out.close();
                return;
            }

            sb.append(arr[i][1] + " " + arr[i + 1][1] + "\n");
        }

        out.print(sb);
        out.close();
    }

    public static boolean isPrime(int n) {
        boolean prime = true;
        for (int j = 2; j <= Math.sqrt(n); j++) {
            if (n % j == 0) {
                prime = false;
                break;
            }
        }

        return prime;
    }
}