#include <bits/stdc++.h>
using namespace std;
long long i, j;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> even;
    vector<long long> odd;
    long long p;
    for (i = 1; i <= 2 * n; i++) {
      cin >> p;
      if (p % 2 == 0)
        even.push_back(i);
      else
        odd.push_back(i);
    }
    long long e = even.size();
    long long o = odd.size();
    if (e % 2 == 0 && o % 2 == 0) {
      if (e >= 2) {
        even.pop_back();
        even.pop_back();
      } else {
        odd.pop_back();
        odd.pop_back();
      }
    } else {
      even.pop_back();
      odd.pop_back();
    }
    for (i = 0; i < even.size(); i += 2) {
      cout << even[i] << " " << even[i + 1] << endl;
    }
    for (i = 0; i < odd.size(); i += 2) {
      cout << odd[i] << " " << odd[i + 1] << endl;
    }
  }
  return 0;
}
