#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int arr[2 * n];
    vector<int> even;
    vector<int> odd;
    for (int i = 0; i < 2 * n; i++) {
      cin >> arr[i];
      if (arr[i] % 2 == 0)
        even.push_back(i + 1);
      else {
        odd.push_back(i + 1);
      }
    }
    int o = odd.size();
    int e = even.size();
    if (o % 2 == 0) {
      if (o > 0)
        o -= 2;
      else {
        e -= 2;
      }
    } else {
      o--;
      e--;
    }
    for (int i = 1; i < e; i += 2) {
      cout << even[i] << " " << even[i - 1] << endl;
    }
    for (int i = 1; i < o; i += 2) {
      cout << odd[i] << " " << odd[i - 1] << endl;
    }
  }
}
