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.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
	Scanner sc;
	BufferedReader in;
	PrintWriter out;
	public static void main(String[] args) {
		new Main().init();
	}
	void init(){
		final long STACK_SIZE = 8*1024*1024;
		new Thread(null, new A(), "RUN", STACK_SIZE).start();
	}
	
	class A implements Runnable{
		A(){}
		Scanner2 sc;
		@Override public void run(){
			try{
//				in = new BufferedReader(new FileReader("input.txt"));
				sc = new Scanner2(new FileInputStream("input.txt"));
				out = new PrintWriter("output.txt");
			}catch(Exception e){
				throw new RuntimeException();
			}
			solve();
		}
		void solve(){
			final int MAX=5001;
			int N=sc.nextInt();
			int[] b=new int[MAX];
			StringBuilder ans = new StringBuilder();
			for(int i=1; i<=2*N; ++i){
				int a=sc.nextInt();
				if(b[a] > 0){
					ans.append(b[a]+" "+i+"\n");
					b[a]=0;
				}else	b[a]=i;
			}
			boolean flag=true;
			for(int i=0; i<MAX; ++i)if(b[i]>0){
				flag=false;
				break;
			}
			if(flag){
				System.out.print(ans);
				out.print(ans);
			}else{
				System.out.println(-1);
				out.println(-1);
			}
			out.flush();
		}
	}
	
	// thanks to wata http://www.codeforces.com/contest/138/submission/978329
	class Scanner2 {
		//InputStream in;
		BufferedInputStream in;
		byte[] buf = new byte[1 << 10];
		int p, n;
		boolean[] isSpace = new boolean[128];
		Scanner2(InputStream in) {
			//this.in = in;
			this.in = new BufferedInputStream(in);
			isSpace[' '] = isSpace['\n'] = isSpace['\r'] = isSpace['\t'] = true;
		}
		int read() {
			if (n == -1) return -1;
			if (p >= n) {
				p = 0;
				try {
					n = in.read(buf);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				if (n <= 0) return -1;
			}
			return buf[p++];
		}
		boolean hasNext() {
			int c = read();
			while (c >= 0 && isSpace[c]) c = read();
			if (c == -1) return false;
			p--;
			return true;
		}
		String next() {
			if (!hasNext()) throw new InputMismatchException();
			StringBuilder sb = new StringBuilder();
			int c = read();
			while (c >= 0 && !isSpace[c]) {
				sb.append((char)c);
				c = read();
			}
			return sb.toString();
		}
		int nextInt() {
			if (!hasNext()) throw new InputMismatchException();
			int 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 (c >= 0 && !isSpace[c]);
			return res * sgn;
		}
	}

}