#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int n1 = 2 * n;
    int a[n1];
    vector<int> e;
    vector<int> o;
    for (int i = 0; i < 2 * n; i++) {
      cin >> a[i];
      if (a[i] % 2) {
        o.push_back(i + 1);
      } else {
        e.push_back(i + 1);
      }
    }
    vector<int> b;
    if (o.size() % 2) {
      o.pop_back();
      e.pop_back();
    } else {
      if (o.size() >= 2) {
        o.pop_back();
        o.pop_back();
      } else {
        e.pop_back();
        e.pop_back();
      }
    }
    int i = 0, j = 0;
    while (i + 1 < o.size()) {
      cout << o[i] << " " << o[i + 1] << '\n';
      i += 2;
    }
    i = 0;
    while (i + 1 < e.size()) {
      cout << e[i] << " " << e[i + 1] << '\n';
      i += 2;
    }
  }
  return 0;
}
