#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, INF = 1e9 + 7;
int n, a[N];
bool used[N];
int main() {
  int q;
  cin >> q;
  while (q--) {
    cin >> n;
    for (int i = 1; i <= n * 2; i++) {
      cin >> a[i];
      used[i] = 0;
    }
    vector<pair<int, int> > vec;
    for (int i = 1; i <= n * 2; i++) {
      if (used[i]) continue;
      for (int j = i + 1; j <= n * 2; j++) {
        if ((a[i] + a[j]) % 2 == 0) {
          used[j] = 1;
          used[i] = 1;
          vec.push_back({i, j});
          break;
        }
      }
    }
    bool cond = 1;
    for (int i = 1; i <= n * 2; i++) {
      if (!used[i]) {
        cond = 0;
      }
    }
    for (int i = 0; i < vec.size() - cond; i++) {
      cout << vec[i].first << " " << vec[i].second << endl;
    }
  }
}
