#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int counter = 0;
    int lkodd = 0;
    int lkeven = 0;
    int dosomething = false;
    for (int j = 1; j <= (2 * n); j++) {
      int temp;
      cin >> temp;
      if (dosomething) {
        continue;
      }
      if (temp % 2 == 0) {
        if (lkeven == 0) {
          lkeven = j;
        } else {
          counter++;
          cout << lkeven << " " << j << " " << endl;
          lkeven = 0;
        }
      } else {
        if (lkodd == 0) {
          lkodd = j;
        } else {
          counter++;
          cout << lkodd << " " << j << endl;
          lkodd = 0;
        }
      }
      if (counter == n - 1) {
        dosomething = true;
      }
    }
  }
  return 0;
}
