#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n;
int a[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> odds, evens;
    for (int i = 1; i <= 2 * n; i++) {
      cin >> a[i];
      if (a[i] % 2)
        odds.push_back(i);
      else
        evens.push_back(i);
    }
    vector<pair<int, int> > ans;
    for (int i = 0; i + 1 < odds.size(); i += 2) {
      ans.push_back({odds[i], odds[i + 1]});
    }
    for (int i = 0; i + 1 < evens.size(); i += 2) {
      ans.push_back({evens[i], evens[i + 1]});
    }
    for (int i = 0; i < n - 1; i++) {
      cout << ans[i].first << ' ' << ans[i].second << '\n';
    }
  }
}
