#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e9;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long tests;
  cin >> tests;
  while (tests--) {
    long long n;
    cin >> n;
    long long arr[2 * n];
    for (long long i = 0; i < (long long)2 * n; i++) cin >> arr[i];
    if (n == 2) {
      cout << "1 2\n";
      continue;
    }
    vector<long long> vec;
    for (long long i = 0; i < (long long)2 * n; i++) {
      if (arr[i] & 1)
        vec.emplace_back(1);
      else
        vec.emplace_back(0);
    }
    vector<pair<long long, long long> > ans;
    bool vis[2 * n];
    memset(vis, 0, sizeof(vis));
    long long cnt = 0;
    for (long long i = 0; i < (long long)2 * n; i++) {
      if (vec[i] == 1 && vis[i] == 0) {
        for (long long j = 0; j < 2 * n; j++) {
          if (j != i && vec[j] == 1 && vis[j] == 0) {
            vis[i] = 1;
            vis[j] = 1;
            ans.emplace_back(make_pair(i + 1, j + 1));
            cnt++;
            break;
          }
        }
      } else if (vec[i] == 0 && vis[i] == 0) {
        for (long long j = 0; j < 2 * n; j++) {
          if (j != i && vec[j] == 0 && vis[j] == 0) {
            vis[i] = 1;
            vis[j] = 1;
            ans.emplace_back(make_pair(i + 1, j + 1));
            cnt++;
            break;
          }
        }
      }
      if (cnt >= n - 1) break;
    }
    for (auto itr : ans) {
      cout << itr.first << " " << itr.second << "\n";
    }
  }
  return 0;
}
