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