#include <bits/stdc++.h>
using namespace std;
void printArray(vector<int> arr) {
  for (int a : arr) cout << a << " ";
  cout << '\n';
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int t, n;
  cin >> t;
  for (int _ = 0; _ < t; _++) {
    cin >> n;
    vector<int> odd;
    vector<int> even;
    for (int i = 0; i < 2 * n; i++) {
      int temp;
      cin >> temp;
      if (temp & 1)
        odd.push_back(i + 1);
      else
        even.push_back(i + 1);
    }
    int i = 0;
    int cnt = 0;
    while (i < (int)odd.size() - 1 && cnt < (n - 1)) {
      cout << odd[i] << " " << odd[i + 1] << '\n';
      i += 2;
      cnt++;
    }
    i = 0;
    while (i < (int)even.size() - 1 && cnt < (n - 1)) {
      cout << even[i] << " " << even[i + 1] << '\n';
      i += 2;
      cnt++;
    }
  }
}
