#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int _i = 0; _i < t; _i++) {
    unsigned long long n;
    cin >> n;
    set<long long> s;
    s.clear();
    for (int i = 0; i < 2 * n; i++) {
      long long a;
      cin >> a;
      if (s.count(a) == 0) {
        cout << a << " ";
        s.insert(a);
      }
    }
    cout << endl;
  }
}
