#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  int n;
  cin >> n;
  vector<int> a(2 * n);
  for (int &v : a) {
    cin >> v;
  }
  vector<int> order(2 * n);
  iota(order.begin(), order.end(), 0);
  sort(order.begin(), order.end(),
       [&a](int v1, int v2) { return a[v1] % 2 < a[v2] % 2; });
  int i = 0;
  int num = n - 1;
  while (i < (2 * n - 1) && num > 0) {
    if (a[order[i]] % 2 == a[order[i + 1]] % 2) {
      cout << order[i] + 1 << " " << order[i + 1] + 1 << "\n";
      --num;
      i += 2;
    } else {
      ++i;
    }
  }
  assert(num == 0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
