#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(2 * n);
  vector<int> ans;
  for (int &e : a) cin >> e;
  for (int i = 0; i < 2 * n; i++) {
    if (a[i] != -1) {
      ans.push_back(a[i]);
      int x = a[i];
      a[i] = -1;
      for (int j = 0; j < 2 * n; j++) {
        if (a[j] == x) {
          a[j] = -1;
        }
      }
    }
  }
  for (int &e : ans) {
    cout << e << " ";
  }
  cout << "\n";
}
signed main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
