#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(2 * n);
  for (int i = 0; i < 2 * n; i++) cin >> v[i];
  vector<int> p[2];
  for (int i = 0; i < 2 * n; i++) p[v[i] % 2].push_back(i + 1);
  vector<pair<long long, long long> > ans;
  for (int i = 0; i < p[0].size(); i += 2)
    if (i + 1 < p[0].size()) ans.push_back({p[0][i], p[0][i + 1]});
  for (int i = 0; i < p[1].size(); i += 2)
    if (i + 1 < p[1].size()) ans.push_back({p[1][i], p[1][i + 1]});
  for (int i = 0; i < n - 1; i++)
    cout << ans[i].first << ' ' << ans[i].second << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
