http://codeforces.com/contest/254/problem/A
// File Name: cf_a.c
// Author: bo_jwolf
// Created Time: 2013年10月14日 星期一 21:22:17
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 1000005;
struct node{
int x, y;
} num[ maxn ];
bool cmp( const node a, const node b ){
return a.x > b.x;
}
int main(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
int n;
scanf( "%d", &n );
for( int i = 1; i <= 2 * n; ++i ){
scanf( "%d", &num[ i ].x );
num[ i ].y = i;
}
sort( num + 1, num + 2 * n + 1 , cmp );
// for( int i = 1; i <= 2 * n; ++i )
// cout << num[ i ].x << endl;
for( int i = 1; i <= 2 * n ; i += 2 ){
if( num[ i ].x != num[ i + 1 ].x ){
puts( "-1" );
return 0;
}
}
for( int i = 1; i <= 2 * n; i += 2 ){
printf( "%d %d\n", num[ i + 1 ].y, num[ i].y );
}
return 0 ;
}