#include <bits/stdc++.h>
using namespace std;
const signed inf = 1000000100;
const long long inf64 = 1ll * inf * inf;
const long long mod = 1e9 + 7;
mt19937 rng(0);
void run() {
  long long n;
  cin >> n;
  vector<long long> a(2 * n);
  for (auto &i : a) cin >> i;
  vector<long long> odd, even;
  for (long long i = 0; i < n * 2; ++i) {
    if (a[i] % 2)
      odd.push_back(i + 1);
    else
      even.push_back(i + 1);
  }
  long long del1, del2;
  if (odd.size() % 2) {
    del1 = even[0];
    del2 = odd[0];
  } else {
    if (odd.size() > 1) {
      del1 = odd[0];
      del2 = odd[1];
    } else {
      del1 = even[0];
      del2 = even[1];
    }
  }
  while (odd.size()) {
    if (odd[odd.size() - 1] == del1 || odd[odd.size() - 1] == del2)
      break;
    else {
      cout << odd[odd.size() - 1] << ' ';
      odd.pop_back();
      cout << odd[odd.size() - 1] << '\n';
      odd.pop_back();
    }
  }
  while (even.size()) {
    if (even[even.size() - 1] == del1 || even[even.size() - 1] == del2)
      break;
    else {
      cout << even[even.size() - 1] << ' ';
      even.pop_back();
      cout << even[even.size() - 1] << '\n';
      even.pop_back();
    }
  }
}
signed main() {
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    run();
    cout.flush();
  }
}
