#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  int n, m, k, i, j, I, J, T, t;
  ll p, q, r, x, y;
  cin >> T;
  while (T--) {
    cin >> n;
    vector<vector<int> > v(2);
    for (i = 1; i <= 2 * n; i++) {
      cin >> m;
      v[m % 2].push_back(i);
    }
    if (v[1].empty())
      v[0].pop_back();
    else
      v[1].pop_back();
    for (i = 0; i < 2; i++)
      for (j = 1; j < v[i].size(); j += 2) {
        cout << v[i][j - 1] << " " << v[i][j] << endl;
      }
    v.clear();
  }
  return 0;
}
