#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    std::vector<long long> v(2 * n), odd, even;
    for (long long i = 0; i < 2 * n; i++) {
      cin >> v[i];
      if (v[i] & 1)
        odd.push_back(i + 1);
      else
        even.push_back(i + 1);
    }
    long long intial = 0;
    long long final = n - 1;
    if (odd.size() & 1) odd.erase(odd.begin());
    if (odd.size() >= 2) {
      for (long long i = 0; i < odd.size(); i = i + 2) {
        if (intial < final) {
          cout << odd[i] << " " << odd[i + 1] << "\n";
          intial++;
        } else
          break;
      }
    }
    if (even.size() & 1) {
      even.erase(even.begin());
    }
    if (even.size() >= 2) {
      for (long long i = 0; i < even.size(); i = i + 2) {
        if (intial < final) {
          cout << even[i] << " " << even[i + 1] << "\n";
          intial++;
        } else
          break;
      }
    }
  }
  return 0;
}
