#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> num(2 * n);
    int numo = 0, nume = 0;
    vector<int> od, ev;
    for (int i = 0; i < 2 * n; i++) {
      cin >> num[i];
      if (num[i] % 2) {
        numo += 1;
        od.push_back(i + 1);
      } else {
        nume += 1;
        ev.push_back(i + 1);
      }
    }
    if (numo % 2) {
      numo--;
      if (nume > 0) {
        nume--;
      } else
        numo--;
    } else {
      if (numo >= 2)
        numo -= 2;
      else
        nume -= 2;
    }
    for (int i = 0; i < numo; i += 2) {
      cout << od[i] << " " << od[i + 1] << endl;
    }
    for (int i = 0; i < nume; i += 2) {
      cout << ev[i] << " " << ev[i + 1] << endl;
    }
  }
  return 0;
}
