#include <bits/stdc++.h>
using namespace std;
long long int n, m, arr[200009], brr[200009], k, l, crr[200009], t, i, j;
char c[200009];
vector<long long int> v, v1;
int main() {
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &n);
    for (i = 1; i <= 2 * n; i++) {
      scanf("%lld", &m);
      if (m % 2)
        v.push_back(i);
      else
        v1.push_back(i);
    }
    if (v.size() % 2 == 1)
      v.pop_back(), v1.pop_back();
    else if (v.size() > 0)
      v.pop_back(), v.pop_back();
    else
      v1.pop_back(), v1.pop_back();
    while (v.size() > 1) {
      printf("%lld ", v.back());
      v.pop_back();
      printf("%lld\n", v.back());
      v.pop_back();
    }
    while (v1.size() > 1) {
      printf("%lld ", v1.back());
      v1.pop_back();
      printf("%lld\n", v1.back());
      v1.pop_back();
    }
    v.clear();
    v1.clear();
  }
  return 0;
}
