#include <bits/stdc++.h>
using namespace std;
int v[110];
int main() {
  int test, n, i;
  cin >> test;
  while (test--) {
    memset(v, 0, sizeof v);
    cin >> n;
    for (int i = 0; i < 2 * n; i++) {
      int s;
      cin >> s;
      if (v[s] == 0) {
        cout << s << " ";
        v[s] = 1;
      }
    }
    cout << endl;
  }
}
