#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v1, v2;
    long long x;
    for (long long i = 0; i < 2 * n; i++) {
      cin >> x;
      if (x % 2 == 0)
        v1.push_back(i + 1);
      else
        v2.push_back(i + 1);
    }
    long long v1size = v1.size();
    long long v2size = v2.size();
    if (v1size == 0 || v2size == 0) {
      if (v1size == 0) {
        for (long long i = 0; i < v2size - 3; i += 2) {
          cout << v2[i] << " " << v2[i + 1] << endl;
        }
      } else {
        for (long long i = 0; i < v1size - 3; i += 2) {
          cout << v1[i] << " " << v1[i + 1] << endl;
        }
      }
      continue;
    }
    if (v1size % 2 == 0) {
      for (long long i = 0; i < v1size - 1; i += 2) {
        cout << v1[i] << " " << v1[i + 1] << endl;
      }
    } else {
      long long tmp;
      if (v1size - 2 < 0)
        tmp = 0;
      else
        tmp = v1size - 2;
      for (long long i = 0; i < tmp; i += 2) {
        cout << v1[i] << " ";
        cout << v1[i + 1] << endl;
      }
    }
    if (v2size % 2 == 0) {
      long long tmp;
      if (v2size - 3 < 0)
        tmp = 0;
      else
        tmp = v2size - 3;
      for (long long i = 0; i < v2size - 3; i += 2) {
        cout << v2[i] << " " << v2[i + 1] << endl;
      }
    } else {
      long long tmp;
      if (v2size - 2 < 0)
        tmp = 0;
      else
        tmp = v2size - 2;
      for (long long i = 0; i < tmp; i += 2) {
        cout << v2[i] << " " << v2[i + 1] << endl;
      }
    }
  }
  return 0;
}
