#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[2 * n];
    bool done[2 * n];
    vector<int> odd, even;
    for (int i = 0; i < 2 * n; i++) {
      done[i] = false;
      cin >> a[i];
      int k = a[i];
      if (k % 2 == 1)
        odd.push_back(k);
      else
        even.push_back(k);
    }
    if (odd.size() % 2 == 0 && odd.size() >= 2) {
      for (int j = 0; j < odd.size() - 2; j += 2) {
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == odd[j] && !done[i]) {
            cout << i + 1 << " ";
            done[i] = true;
            break;
          }
        }
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == odd[j + 1] && !done[i]) {
            cout << i + 1 << endl;
            done[i] = true;
            break;
          }
        }
      }
      for (int j = 0; j < even.size(); j += 2) {
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == even[j] && !done[i]) {
            cout << i + 1 << " ";
            done[i] = true;
            break;
          }
        }
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == even[j + 1] && !done[i]) {
            cout << i + 1 << endl;
            done[i] = true;
            break;
          }
        }
      }
    } else if (odd.size() >= 1) {
      for (int j = 0; j < odd.size() - 1; j += 2) {
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == odd[j] && !done[i]) {
            cout << i + 1 << " ";
            done[i] = true;
            break;
          }
        }
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == odd[j + 1] && !done[i]) {
            cout << i + 1 << endl;
            done[i] = true;
            break;
          }
        }
      }
      for (int j = 0; j < even.size() - 1; j += 2) {
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == even[j] && !done[i]) {
            cout << i + 1 << " ";
            done[i] = true;
            break;
          }
        }
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == even[j + 1] && !done[i]) {
            cout << i + 1 << endl;
            done[i] = true;
            break;
          }
        }
      }
    } else {
      for (int j = 0; j < even.size() - 2; j += 2) {
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == even[j] && !done[i]) {
            cout << i + 1 << " ";
            done[i] = true;
            break;
          }
        }
        for (int i = 0; i < 2 * n; i++) {
          if (a[i] == even[j + 1] && !done[i]) {
            cout << i + 1 << endl;
            done[i] = true;
            break;
          }
        }
      }
    }
  }
}
