#include <bits/stdc++.h>
using namespace std;
int a[2005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a_1[2005], a_2[2005];
    int x = 0, y = 0;
    memset(a_1, 0, sizeof(a_1));
    memset(a_2, 0, sizeof(a_2));
    for (int i = 1; i <= 2 * n; i++) cin >> a[i];
    for (int i = 1; i <= 2 * n; i++) {
      if (a[i] % 2 == 0) a_2[++x] = i;
      if (a[i] % 2 != 0) a_1[++y] = i;
    }
    if (x % 2 == 0) {
      if (x >= 2) {
        for (int i = 3; i <= x - 1; i += 2)
          cout << a_2[i] << " " << a_2[i + 1] << endl;
        for (int i = 1; i <= y - 1; i += 2)
          cout << a_1[i] << " " << a_1[i + 1] << endl;
      } else {
        for (int i = 3; i <= y - 1; i += 2)
          cout << a_1[i] << " " << a_1[i + 1] << endl;
        for (int i = 1; i <= x - 1; i += 2)
          cout << a_2[i] << " " << a_2[i + 1] << endl;
      }
    } else {
      for (int i = 2; i <= x - 1; i += 2)
        cout << a_2[i] << " " << a_2[i + 1] << endl;
      for (int i = 2; i <= y - 1; i += 2)
        cout << a_1[i] << " " << a_1[i + 1] << endl;
    }
  }
  return 0;
}
