#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int x, a[2 * n];
    vector<int> odds, evens;
    for (int i = 0; i < 2 * n; i++) {
      cin >> x;
      a[i] = x;
      if (x % 2 == 0)
        evens.push_back(i + 1);
      else
        odds.push_back(i + 1);
    }
    if (odds.size() % 2 != 0) {
      evens.pop_back();
      odds.pop_back();
    } else if (evens.size()) {
      evens.pop_back();
      evens.pop_back();
    } else {
      odds.pop_back();
      odds.pop_back();
    }
    for (int i = 0; i < evens.size(); i++) {
      cout << evens[i] << " ";
      if (i % 2) cout << endl;
    }
    for (int i = 0; i < odds.size(); i++) {
      cout << odds[i] << " ";
      if (i % 2) cout << endl;
    }
  }
  return 0;
}
