#include <bits/stdc++.h>
using namespace std;
int t;
int n;
int a[2001];
bool even(int x) { return (x + 1) % 2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> n;
    int sum = 0;
    vector<int> evens;
    vector<int> odds;
    for (int i = 1; i <= 2 * n; i++) {
      cin >> a[i];
      sum += a[i];
      if (even(a[i])) {
        evens.push_back(i);
      } else {
        odds.push_back(i);
      }
    }
    int e_num = evens.size();
    int o_num = odds.size();
    int e = 0;
    int o = 0;
    for (int i = 0; i < n - 1; i++) {
      if (o_num >= 2) {
        cout << odds.at(o) << " " << odds.at(o + 1) << endl;
        o += 2;
        o_num -= 2;
      } else {
        cout << evens.at(e) << " " << evens.at(e + 1) << endl;
        e += 2;
      }
    }
  }
}
