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