#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long inf = 1e9 + 7;
long long modexp(long long base, long long power) {
  if (power == 0) return 1;
  if (power & 1) return base * modexp(base, power - 1) % inf;
  return modexp(base * base % inf, power / 2);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(2 * n);
    vector<long long> b, c;
    for (long long i = 0; i < (2 * n); i++) {
      cin >> a[i];
      if (a[i] % 2 == 0)
        b.push_back(i + 1);
      else
        c.push_back(i + 1);
    }
    if (b.size() == 0) {
      for (long long i = 0; i < (c.size() - 2); i++) {
        cout << c[i] << " ";
        if (i % 2 != 0) cout << "\n";
      }
    } else {
      if (b.size() % 2 == 0) {
        for (long long i = 0; i < (b.size() - 2); i++) {
          cout << b[i] << " ";
          if (i % 2 != 0) cout << "\n";
        }
        for (long long i = 0; i < (c.size()); i++) {
          cout << c[i] << " ";
          if (i % 2 != 0) cout << "\n";
        }
      } else {
        for (long long i = 0; i < (b.size() - 1); i++) {
          cout << b[i] << " ";
          if (i % 2 != 0) cout << "\n";
        }
        for (long long i = 0; i < (c.size() - 1); i++) {
          cout << c[i] << " ";
          if (i % 2 != 0) cout << "\n";
        }
      }
    }
  }
  return 0;
}
