#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9;
const int Mod = 1e9 + 7;
const long long OO = 1e18;
const int N = 2e3 + 5;
int test, a[N], n;
vector<int> vc[2];
void in() {
  cin >> n;
  vc[0].clear();
  vc[1].clear();
  for (int i = 1; i <= 2 * n; i++) cin >> a[i], vc[a[i] % 2].push_back(i);
}
void solve() {
  int x = vc[0].size();
  x /= 2;
  x = min(x, n - 1);
  int k = n - 1;
  k -= x;
  for (int i = 0; i < x; i++)
    cout << vc[0][2 * i] << " " << vc[0][2 * i + 1] << '\n';
  if (!k) return;
  int y = vc[1].size();
  y /= 2;
  k = min(k, y);
  for (int i = 0; i < k; i++)
    cout << vc[1][2 * i] << " " << vc[1][2 * i + 1] << '\n';
}
int main() {
  if (fopen("trash.inp", "r"))
    freopen("trash.inp", "r", stdin), freopen("trash.out", "w", stdout);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> test;
  while (test--) {
    in();
    solve();
  }
}
