#include <bits/stdc++.h>
using namespace std;
int main() {
  short t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[2 * n];
    int odds_indices[2 * n];
    int evens_indices[2 * n];
    int count_odd = 0;
    int count_even = 0;
    for (int i = 0; i < 2 * n; i++) {
      cin >> a[i];
      if (a[i] % 2 == 1) {
        odds_indices[count_odd] = i;
        count_odd = count_odd + 1;
      } else {
        evens_indices[count_even] = i;
        count_even = count_even + 1;
      }
    }
    if (count_odd % 2 == 1 && count_even % 2 == 1) {
      for (int j = 0; j < count_odd - 1;) {
        cout << odds_indices[j] + 1 << " " << odds_indices[j + 1] + 1 << "\n";
        j = j + 2;
      }
      for (int j = 0; j < count_even - 1;) {
        cout << evens_indices[j] + 1 << " " << evens_indices[j + 1] + 1 << "\n";
        j = j + 2;
      }
    } else {
      if (count_odd >= 2) {
        for (int j = 0; j < count_odd - 2;) {
          cout << odds_indices[j] + 1 << " " << odds_indices[j + 1] + 1 << "\n";
          j = j + 2;
        }
        for (int j = 0; j < count_even;) {
          cout << evens_indices[j] + 1 << " " << evens_indices[j + 1] + 1
               << "\n";
          j = j + 2;
        }
      } else {
        for (int j = 0; j < count_even - 2;) {
          cout << evens_indices[j] + 1 << " " << evens_indices[j + 1] + 1
               << "\n";
          j = j + 2;
        }
        for (int j = 0; j < count_odd;) {
          cout << odds_indices[j] + 1 << " " << odds_indices[j + 1] + 1 << "\n";
          j = j + 2;
        }
      }
    }
  }
  return 0;
}
