#include <bits/stdc++.h>
using namespace std;
long long inf = 1e18;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long m;
    cin >> m;
    vector<long long> a(2 * m);
    for (long long i = 0; i < 2 * m; i++) cin >> a[i];
    ;
    vector<long long> o, e;
    for (long long i = 0; i < 2 * m; i++) {
      if (a[i] & 1)
        o.push_back(i);
      else
        e.push_back(i);
    }
    long long se = e.size(), so = o.size();
    if (se == 0) {
      for (long long i = 3; i < o.size(); i += 2)
        cout << o[i] + 1 << " " << o[i - 1] + 1 << endl;
      continue;
    }
    if (se % 2 == 1) {
      for (long long i = 1; i < e.size() - 1; i += 2)
        cout << e[i] + 1 << " " << e[i - 1] + 1 << endl;
      for (long long i = 1; i < o.size() - 1; i += 2)
        cout << o[i] + 1 << " " << o[i - 1] + 1 << endl;
    } else {
      for (long long i = 3; i < e.size(); i += 2)
        cout << e[i] + 1 << " " << e[i - 1] + 1 << endl;
      for (long long i = 1; i < o.size(); i += 2)
        cout << o[i] + 1 << " " << o[i - 1] + 1 << endl;
    }
  }
}
