#include <bits/stdc++.h>
using namespace std;
void solve() {
  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> o, e;
  for (long long i = 0; i < 2 * n; i++) {
    if (a[i] % 2 == 0)
      e.push_back(i + 1);
    else
      o.push_back(i + 1);
  }
  if (e.size() % 2 == 0) {
    if (e.size() == 0) {
      for (long long i = 0; i < o.size() - 2; i += 2)
        cout << o[i] << " " << o[i + 1] << "\n";
    } else if (o.size() == 0) {
      for (long long i = 0; i < e.size() - 2; i += 2)
        cout << e[i] << " " << e[i + 1] << "\n";
    } else {
      for (long long i = 0; i < e.size() - 2; i += 2)
        cout << e[i] << " " << e[i + 1] << "\n";
      for (long long i = 0; i < o.size() - 1; i += 2)
        cout << o[i] << " " << o[i + 1] << "\n";
    }
  } else {
    for (long long i = 0; i < e.size() - 1; i += 2)
      cout << e[i] << " " << e[i + 1] << "\n";
    for (long long i = 0; i < o.size() - 1; i += 2)
      cout << o[i] << " " << o[i + 1] << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
