#include <bits/stdc++.h>
using namespace std;
long long arr[10001];
int main() {
  ios::sync_with_stdio(false);
  long long T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    long long m = 2 * n;
    for (int i = 1; i <= m; i++) cin >> arr[i];
    vector<long long> e, o;
    for (int i = 1; i <= m; i++) {
      if (arr[i] % 2 == 0)
        e.push_back(i);
      else
        o.push_back(i);
    }
    if (!o.size()) {
      e.pop_back(), e.pop_back();
      for (int i = 0; i < e.size() - 1; i += 2)
        cout << e[i] << " " << e[i + 1] << endl;
    } else if (!e.size()) {
      o.pop_back(), o.pop_back();
      for (int i = 0; i < o.size() - 1; i += 2)
        cout << o[i] << " " << o[i + 1] << endl;
    } else if (o.size() == 2) {
      for (int i = 0; i < e.size() - 1; i += 2)
        cout << e[i] << " " << e[i + 1] << endl;
    } else if (o.size() == 1) {
      for (int i = 0; i < e.size() - 1; i += 2)
        cout << e[i] << " " << e[i + 1] << endl;
    } else if (o.size() > 2 && o.size() % 2 == 0) {
      o.pop_back(), o.pop_back();
      for (int i = 0; i < o.size() - 1; i += 2)
        cout << o[i] << " " << o[i + 1] << endl;
      if (e.size() != 0)
        for (int i = 0; i < e.size() - 1; i += 2)
          cout << e[i] << " " << e[i + 1] << endl;
    } else if (o.size() > 2 && o.size() % 2 == 1) {
      o.pop_back(), e.pop_back();
      for (int i = 0; i < o.size() - 1; i += 2)
        cout << o[i] << " " << o[i + 1] << endl;
      if (e.size() != 0)
        for (int i = 0; i < e.size() - 1; i += 2)
          cout << e[i] << " " << e[i + 1] << endl;
    }
  }
  return 0;
}
