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