#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    long long arr[(2 * n)];
    vector<long long> even;
    vector<long long> odd;
    for (long long i = 0; i < (2 * n); i++) {
      cin >> arr[i];
      if ((arr[i] % 2) == 1) {
        odd.push_back(i + 1);
      } else
        even.push_back(i + 1);
    }
    long long c = 0;
    map<long long, long long> m;
    for (long long i = 0; i + 1 < odd.size(); i += 2) {
      m.insert({odd[i], odd[i + 1]});
      c++;
      if (c == n - 1) break;
    }
    for (long long i = 0; i + 1 < even.size(); i += 2) {
      if (c == n - 1) break;
      m.insert({even[i], even[i + 1]});
      c++;
    }
    for (auto x : m) {
      cout << x.first << " " << x.second << "\n";
    }
  }
  return 0;
}
