#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v;
    for (long long i = 0; i < 2 * n; i++) {
      long long a;
      cin >> a;
      v.push_back(a);
    }
    long long cnt = 0;
    for (long long i = 0; i < 2 * n; i++) {
      for (long long j = i + 1; j < 2 * n; j++) {
        if (v[i] > 0 && v[j] > 0) {
          if ((v[i] % 2 == 0 && v[j] % 2 == 0) || (v[i] % 2 && v[j] % 2)) {
            cout << i + 1 << " " << j + 1 << endl;
            v[i] = 0;
            v[j] = 0;
            ++cnt;
            break;
          }
        }
      }
      if (cnt == (n - 1)) break;
    }
  }
  return 0;
}
