#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int a[2 * n], E[2 * n], O[2 * n], e = 0, o = 0;
  for (int i = 0; i < 2 * n; i++)
    cin >> a[i], (a[i] % 2) ? (O[o] = i + 1, o++) : (E[e] = i + 1, e++);
  int x = n - 1, i = 0, j = 0;
  while (x >= 1 && i < e && i + 1 < e) {
    cout << E[i] << " " << E[i + 1] << " " << '\n';
    i = i + 2;
    x--;
  }
  while (x >= 1 && j < o && j + 1 < o) {
    cout << O[j] << " " << O[j + 1] << " " << '\n';
    j = j + 2;
    x--;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
