#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, ce{}, co{};
    cin >> n;
    vector<pair<int, int>> vec1, vec2;
    long long arr[2 * n];
    for (int i = 0; i < (2 * n); i++) {
      cin >> arr[i];
      if (arr[i] % 2 == 0) {
        vec1.push_back(make_pair(arr[i], i + 1));
        ce++;
      } else {
        vec2.push_back(make_pair(arr[i], i + 1));
        co++;
      }
    }
    vector<pair<int, int>>::iterator it1, it;
    it1 = vec2.begin();
    it = vec1.begin();
    if (co >= ce) {
      if (co % 2 == 0) {
        vec2.erase(it1, it1 + 2);
      } else {
        vec2.erase(it1);
        vec1.erase(it);
      }
    } else {
      if (ce % 2 == 0) {
        vec1.erase(it, it + 2);
      } else {
        vec2.erase(it1);
        vec1.erase(it);
      }
    }
    for (int i = 0; (i + 1) < vec2.size(); i = i + 2) {
      cout << vec2[i].second << " " << vec2[i + 1].second << endl;
    }
    for (int i = 0; (i + 1) < vec1.size(); i = i + 2) {
      cout << vec1[i].second << " " << vec1[i + 1].second << endl;
    }
  }
  return 0;
}
