#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> odd;
  vector<int> even;
  for (int i = 0; i < 2 * n; i++) {
    int s;
    cin >> s;
    if (s % 2 == 0)
      even.push_back(i);
    else
      odd.push_back(i);
  }
  int o = odd.size(), e = even.size();
  if (o == 0) {
    even.pop_back();
    even.pop_back();
    for (int i = 0; i < e - 2; i += 2) {
      cout << even[i] + 1 << " " << even[i + 1] + 1 << endl;
    }
    return;
  }
  if (e == 0) {
    odd.pop_back();
    odd.pop_back();
    for (int i = 0; i < o - 2; i += 2) {
      cout << odd[i] + 1 << " " << odd[i + 1] + 1 << endl;
    }
    return;
  }
  if (o % 2 == 0) {
    odd.pop_back();
    odd.pop_back();
    for (int i = 0; i < e; i += 2) {
      cout << even[i] + 1 << " " << even[i + 1] + 1 << endl;
    }
    for (int i = 0; i < o - 2; i += 2) {
      cout << odd[i] + 1 << " " << odd[i + 1] + 1 << endl;
    }
    return;
  } else {
    odd.pop_back();
    even.pop_back();
    for (int i = 0; i < e - 1; i += 2) {
      cout << even[i] + 1 << " " << even[i + 1] + 1 << endl;
    }
    for (int i = 0; i < o - 1; i += 2) {
      cout << odd[i] + 1 << " " << odd[i + 1] + 1 << endl;
    }
  }
  return;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
