#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[100010];
void solve() {
  scanf("%d", &n);
  vector<int> f, s;
  f.clear(), s.clear();
  for (int i = 1; i <= 2 * n; i++) {
    scanf("%d", &a[i]);
    if (a[i] % 2 == 0) {
      f.push_back(i);
    } else {
      s.push_back(i);
    }
  }
  if (s.size() % 2 == 1) {
    int fir = 1, f1 = 1;
    for (int i = f1; i < f.size(); i += 2) {
      printf("%d %d\n", f[i], f[i + 1]);
    }
    for (int i = fir; i < s.size(); i += 2) {
      printf("%d %d\n", s[i], s[i + 1]);
    }
  } else {
    int fir = 2, f1 = 0;
    if (s.size() == 0) fir = 0, f1 = 2;
    for (int i = f1; i < f.size(); i += 2) {
      printf("%d %d\n", f[i], f[i + 1]);
    }
    for (int i = fir; i < s.size(); i += 2) {
      printf("%d %d\n", s[i], s[i + 1]);
    }
  }
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    solve();
  }
}
