#include <bits/stdc++.h>
using namespace std;
void call(vector<int> a) {
  int less = 0;
  if (a.size() % 2 != 0)
    less = 1;
  else
    less = 2;
  for (int i = 0; i < a.size() - less; i += 2) {
    cout << a[i] << " " << a[i + 1] << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<int> odd, even;
    int x, e = 0, o = 0;
    for (int i = 0; i < 2 * n; i++) {
      cin >> x;
      if (x % 2 != 0) {
        odd.push_back(i + 1);
        o++;
      } else {
        even.push_back(i + 1);
        e++;
      }
    }
    if (odd.size() % 2 != 0) {
      call(even);
      call(odd);
    } else {
      if (even.size() >= odd.size()) {
        call(even);
        for (int i = 0; i < odd.size(); i += 2)
          cout << odd[i] << " " << odd[i + 1] << endl;
      } else {
        call(odd);
        for (int i = 0; i < even.size(); i += 2)
          cout << even[i] << " " << even[i + 1] << endl;
      }
    }
  }
}
