#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1, i, j, k;
  cin >> t;
  for (long long ii = 1; ii <= t; ii++) {
    long long n;
    cin >> n;
    n = 2 * n;
    vector<long long> a(n), b, c;
    for (i = 0; i < n; i++) cin >> a[i];
    vector<pair<long long, long long> > ans;
    for (i = 0; i < n; i++) {
      if (a[i] % 2)
        b.push_back(i + 1);
      else
        c.push_back(i + 1);
    }
    k = n / 2;
    for (i = 0; i + 1 < b.size() && k--; i += 2)
      ans.push_back(make_pair(b[i], b[i + 1]));
    for (i = 0; i + 1 < c.size() && k--; i += 2)
      ans.push_back(make_pair(c[i], c[i + 1]));
    k = n / 2;
    for (i = 0; i + 1 < k; i++)
      cout << ans[i].first << " " << ans[i].second << '\n';
  }
  return 0;
}
