#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int32_t main() {
  long long t = 1;
  long long n;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<long long> even, odd;
    for (long long i = 1; i <= 2 * n; i++) {
      cin >> a[i];
      if (a[i] % 2)
        odd.push_back(i);
      else
        even.push_back(i);
    }
    vector<pair<long long, long long>> ans;
    for (long long i = 0; i + 1 < even.size(); i += 2)
      ans.push_back({even[i], even[i + 1]});
    for (long long i = 0; i + 1 < odd.size(); i += 2)
      ans.push_back({odd[i], odd[i + 1]});
    for (long long i = 0; i < n - 1; i++) {
      cout << ans[i].first << ' ' << ans[i].second << "\n";
    }
  }
  return 0;
}
