#include <bits/stdc++.h>
int main() {
  int n, leng;
  int arr[2005];
  scanf("%d", &n);
  for (int j = 0; j < n; j++) {
    scanf("%d", &leng);
    int x = 0, y = 0;
    int cont = 0;
    int arrEven[2005] = {0};
    int arrOdd[2005] = {0};
    for (int i = 0; i < leng * 2; i++) {
      scanf("%d", &arr[i]);
      if (arr[i] % 2 == 0) {
        arrEven[x] = arr[i];
        x++;
      } else {
        arrOdd[y] = arr[i];
        y++;
      }
    }
    if (x % 2 == 0 && y % 2 == 0) {
      if (x > 2) {
        x -= 2;
      } else {
        y -= 2;
      }
      for (int h = 0; h < x; h++) {
        for (int g = 0; g < leng * 2; g++) {
          if (arrEven[h] == arr[g]) {
            printf("%d ", g + 1);
            arr[g] = '\0';
            cont++;
            if (cont == 2) {
              printf("\n");
              cont = 0;
            }
            break;
          }
        }
      }
      cont = 0;
      for (int H = 0; H < y; H++) {
        for (int G = 0; G < leng * 2; G++) {
          if (arrOdd[H] == arr[G]) {
            printf("%d ", G + 1);
            arr[G] = '\0';
            cont++;
            if (cont == 2) {
              printf("\n");
              cont = 0;
            }
            break;
          }
        }
      }
    } else {
      x -= 1;
      y -= 1;
      for (int a = 0; a < x; a++) {
        for (int b = 0; b < leng * 2; b++) {
          if (arrEven[a] == arr[b]) {
            printf("%d ", b + 1);
            arr[b] = '\0';
            cont++;
            if (cont == 2) {
              printf("\n");
              cont = 0;
            }
            break;
          }
        }
      }
      cont = 0;
      for (int A = 0; A < y; A++) {
        for (int B = 0; B < leng * 2; B++) {
          if (arrOdd[A] == arr[B]) {
            printf("%d ", B + 1);
            arr[B] = '\0';
            cont++;
            if (cont == 2) {
              printf("\n");
              cont = 0;
            }
            break;
          }
        }
      }
    }
  }
  return 0;
}
