#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (size_t i = 0; i < t; i++) {
    int n;
    cin >> n;
    list<pair<int, int>> l;
    int odd = -1;
    int even = -1;
    for (size_t i = 0; i < n * 2; i++) {
      int a;
      cin >> a;
      if (a % 2 == 0) {
        if (even >= 0) {
          l.push_back(make_pair(even, i));
          even = -1;
        } else {
          even = i;
        }
      } else if (a % 2 != 0) {
        if (odd >= 0) {
          l.push_back(make_pair(odd, i));
          odd = -1;
        } else {
          odd = i;
        }
      }
    }
    if (odd >= 0) {
      for (pair<int, int> p : l) {
        cout << p.first + 1 << ' ' << p.second + 1 << endl;
      }
    } else {
      l.pop_back();
      for (pair<int, int> p : l) {
        cout << p.first + 1 << ' ' << p.second + 1 << endl;
      }
    }
  }
  return 0;
}
