#include <bits/stdc++.h>
using namespace std;
void print_vector(vector<long long> a) {
  for (long long i = 0; i < a.size(); i++) cout << a[i] << " ";
  cout << endl;
}
void print_set(set<long long> a) {
  set<long long>::iterator itr;
  for (itr = a.begin(); itr != a.end(); itr++) cout << *itr << " ";
  cout << endl;
}
void print_array(long long* a, int n) {
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long p = power(x, y / 2) % 998244353;
  p = (p * p) % 998244353;
  return (y % 2 == 0) ? p : (x * p) % 998244353;
}
long long fact(long long n) {
  long long res = 1;
  for (long long i = 2; i <= n; i++) res = res * i, res = res % 998244353;
  return res;
}
long long ncr(long long n, long long r) {
  return fact(n) / (fact(r) * fact(n - r));
}
long long fib(long long a) {
  if (a == 0) return 1;
  vector<long long> l(a);
  if (a == 1)
    return 2;
  else if (a == 2)
    return 3;
  else {
    l[0] = 2;
    l[1] = 3;
    for (long long i = 2; i < a; i++) {
      l[i] = (l[i - 1] % 998244353) + (l[i - 2] % 998244353);
    }
  }
  long long ans = (l[a - 1] % 998244353);
  return ans;
}
long long min(long long a, long long b) {
  if (a >= b)
    return b;
  else
    return a;
}
long long max(long long a, long long b) {
  if (a >= b)
    return a;
  else
    return b;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> l(2 * n);
    for (long long i = 0; i < 2 * n; i++) cin >> l[i];
    vector<long long> o;
    vector<long long> e;
    for (long long i = 0; i < 2 * n; i++) {
      if (l[i] % 2 == 0)
        e.push_back(i + 1);
      else
        o.push_back(i + 1);
    }
    long long esize = e.size();
    long long osize = o.size();
    if (e.size() % 2 == 1) {
      esize = esize - 1;
      osize = osize - 1;
    } else {
      if (osize > esize) {
        osize = osize - 2;
      } else {
        esize = esize - 2;
      }
    }
    for (long long i = 0; i < osize / 2; i++) {
      cout << o[i] << " " << o[osize - 1 - i] << endl;
    }
    for (long long i = 0; i < esize / 2; i++) {
      cout << e[i] << " " << e[esize - 1 - i] << endl;
      ;
    }
  }
  return 0;
}
