#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
const int MOD = 1000000007;
const int FMOD = 998244353;
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[2 * n];
    for (long long i = 0; i < 2 * n; i++) cin >> a[i];
    vector<long long> even, odd;
    for (long long i = 0; i < 2 * n; i++) {
      if (a[i] % 2 == 0)
        even.push_back(i + 1);
      else
        odd.push_back(i + 1);
    }
    long long c = 0;
    if (even.size() > 0) {
      for (long long i = 0; i < even.size() - 1; i += 2) {
        if (c == n - 1) break;
        cout << even[i] << " " << even[i + 1] << "\n";
        c++;
      }
    }
    if (odd.size() > 0) {
      for (long long i = 0; i < odd.size() - 1; i += 2) {
        if (c == n - 1) break;
        cout << odd[i] << " " << odd[i + 1] << "\n";
        c++;
      }
    }
  }
  return 0;
}
