#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    stack<int> c, b;
    cin >> n;
    for (int i = 0; i < 2 * n; i++) {
      int a;
      cin >> a;
      if (a % 2 == 0)
        c.push(i + 1);
      else
        b.push(i + 1);
    }
    if (c.size() % 2 != 0) {
      c.pop();
      b.pop();
    } else if (c.size() > b.size()) {
      c.pop();
      c.pop();
    } else {
      b.pop();
      b.pop();
    }
    while (!b.empty()) {
      cout << b.top() << " ";
      b.pop();
      cout << b.top() << " ";
      b.pop();
      cout << endl;
    }
    while (!c.empty()) {
      cout << c.top() << " ";
      c.pop();
      cout << c.top() << " ";
      c.pop();
      cout << endl;
    }
  }
  return 0;
}
