#include <bits/stdc++.h>
using namespace std;
inline int qpow(int b, long long e) {
  int a = 1;
  for (; e; e >>= 1, b = (long long)b * b)
    if (e & 1) a = (long long)a * b;
  return a;
}
const int maxn = 2222;
int a[maxn];
vector<int> odd, even;
void solve() {
  int n;
  cin >> n;
  odd.clear();
  even.clear();
  for (int i = 1; i <= (2 * n); ++i) {
    cin >> a[i];
    if (a[i] & 1)
      odd.push_back(i);
    else
      even.push_back(i);
  }
  int cnt = n - 1;
  while (cnt--) {
    if (odd.size() >= 2) {
      cout << *odd.rbegin() << " " << *++odd.rbegin() << endl;
      odd.pop_back();
      odd.pop_back();
    } else if (even.size() >= 2) {
      cout << *even.rbegin() << " " << *++even.rbegin() << endl;
      even.pop_back();
      even.pop_back();
    }
  }
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
}
