#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    int n, cnt_ev = 0, cnt_odd = 0, first_odd = 0;
    cin >> n;
    bool ava[10005] = {0};
    memset(ava, 1, sizeof(ava));
    vector<int> v;
    v.push_back(0);
    for (int i = 1; i <= 2 * n; i++) {
      int x;
      cin >> x;
      v.push_back(x);
      if (x % 2 == 0) {
        if (!cnt_ev) ava[i] = {0};
        cnt_ev++;
      } else {
        if (!cnt_odd) first_odd = i;
        cnt_odd++;
      }
    }
    if (cnt_odd % 2 != 0) ava[first_odd] = 0;
    int cnt = 1;
    for (int i = 1; i <= 2 * n; i++) {
      if (!ava[i]) continue;
      for (int j = 1; j <= 2 * n; j++) {
        if (i == j) continue;
        if (ava[i] && ava[j] && (v[i] + v[j]) % 2 == 0 && cnt < n) {
          cout << i << " " << j << endl;
          ava[i] = 0;
          ava[j] = 0;
          cnt++;
          break;
        }
      }
    }
  }
}
