#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, p;
    cin >> n;
    vector<int> v1, v2;
    for (int i = 0; i < 2 * n; ++i) {
      cin >> p;
      if (p % 2 == 0)
        v1.push_back(i + 1);
      else
        v2.push_back(i + 1);
    }
    int done = 0;
    if (v1.size() > 1) {
      if (v2.size() == 0)
        for (int i = 0; i < v1.size() - 2; i += 2) {
          cout << v1[i] << " " << v1[i + 1] << "\n";
          ++done;
        }
      else {
        for (int i = 0; i < v1.size() - 1; i += 2) {
          cout << v1[i] << " " << v1[i + 1] << "\n";
          ++done;
        }
      }
    }
    int i = 0;
    while (done < n - 1) {
      cout << v2[i] << " " << v2[i + 1] << "\n";
      i += 2;
      done++;
    }
  }
}
