#include <bits/stdc++.h>
using namespace std;
long long pow(long long c, long long d) { return d == 0 ?: c * pow(c, d - 1); }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v(2 * n);
    vector<pair<long long, long long> > vo, ve;
    long long od = 0, ev = 0;
    for (long long i = 0; i < 2 * n; i++) {
      cin >> v[i];
      if (v[i] % 2 == 0) {
        ve.push_back(make_pair(v[i], i + 1));
        ev++;
      } else {
        vo.push_back(make_pair(v[i], i + 1));
        od++;
      }
    }
    if (ev % 2 == 1) {
      for (long long i = 1; i < ve.size(); i += 2) {
        cout << ve[i].second << " " << ve[i + 1].second << endl;
      }
      for (long long i = 1; i < vo.size(); i += 2) {
        cout << vo[i].second << " " << vo[i + 1].second << endl;
      }
    } else {
      if (ve.size() > 2) {
        for (long long i = 2; i < ve.size(); i += 2) {
          cout << ve[i].second << " " << ve[i + 1].second << endl;
        }
        for (long long i = 0; i < vo.size(); i += 2) {
          cout << vo[i].second << " " << vo[i + 1].second << endl;
        }
      } else {
        for (long long i = 0; i < ve.size(); i += 2) {
          cout << ve[i].second << " " << ve[i + 1].second << endl;
        }
        for (long long i = 2; i < vo.size(); i += 2) {
          cout << vo[i].second << " " << vo[i + 1].second << endl;
        }
      }
    }
  }
  return 0;
}
