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