#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    std::vector<pair<long long int, long long int> > ev;
    std::vector<pair<long long int, long long int> > od;
    for (int i = 1; i <= 2 * n; i++) {
      int x;
      cin >> x;
      if (x % 2 == 0)
        ev.push_back({x, i});
      else
        od.push_back({x, i});
    }
    if (ev.size() % 2 == 0) {
      if (ev.size() == 0) {
        od.pop_back();
        od.pop_back();
      } else {
        ev.pop_back();
        ev.pop_back();
      }
    } else {
      ev.pop_back();
      od.pop_back();
    }
    for (int i = 0; i < ev.size(); i += 2)
      cout << ev[i].second << " " << ev[i + 1].second << "\n";
    for (int i = 0; i < od.size(); i += 2)
      cout << od[i].second << " " << od[i + 1].second << "\n";
  }
  return 0;
}
