#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<pair<int, int> > v;
    vector<int> q;
    int a[2000];
    memset(a, 0, sizeof a);
    for (int i = 0; i < 2 * n; i++) {
      int w;
      cin >> w;
      q.push_back(w);
    }
    for (int i = 0; i < 2 * n; i++) {
      for (int j = i + 1; j < 2 * n; j++) {
        if (((q[i] + q[j]) % 2 == 0) && a[i] == 0 && a[j] == 0) {
          a[i] = 1;
          a[j] = 1;
          v.push_back({i, j});
          break;
        }
      }
    }
    for (int i = 0; i < n - 1; i++) {
      cout << v[i].first + 1 << " " << v[i].second + 1 << endl;
    }
  }
}
