#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const long long MOD = 1e9 + 7;
using namespace std;
long long n_bits(long long n) {
  long long x = __builtin_popcount(n);
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[2 * n];
    std::vector<long long> odd, even;
    for (int i = 0; i < (2 * n); ++i) {
      cin >> a[i];
      if (a[i] & 1)
        odd.push_back(i + 1);
      else {
        even.push_back(i + 1);
      }
    }
    if (odd.size() & 1) {
      odd.pop_back();
      even.pop_back();
    } else {
      if (odd.size() > 1) {
        odd.pop_back();
        odd.pop_back();
      } else {
        even.pop_back();
        even.pop_back();
      }
    }
    for (int i = 0; i < (odd.size()); ++i) {
      cout << odd[i] << " ";
      i++;
      cout << odd[i] << endl;
    }
    for (int i = 0; i < (even.size()); ++i) {
      cout << even[i] << " ";
      i++;
      cout << even[i] << endl;
    }
  }
  return 0;
}
