#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 0; i < 2 * n; i++) {
    int t;
    cin >> t;
    if (s.find(t) == s.end()) {
      cout << t << " ";
      s.insert(t);
    }
  }
  cout << endl;
}
int main() {
  c_p_c();
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
