#include <bits/stdc++.h>
using namespace std;
const int d4i[4] = {-1, 0, 1, 0}, d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
          d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void DBG() {
  cout << "]"
       << "\n";
}
template <class H, class... T>
void DBG(H h, T... t) {
  cout << to_string(h);
  if (sizeof...(t)) cout << ", ";
  DBG(t...);
}
int t, n;
int a[(long long)5005];
bool mt[101];
void solve() {
  memset(mt, 0, sizeof mt);
  vector<int> ans;
  for (int i = (1); i <= (n << 1); ++i) {
    if (!mt[a[i]]) {
      ans.push_back(a[i]);
      mt[a[i]] = true;
    }
  }
  for (auto i : ans) cout << i << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = (1); i <= (n << 1); ++i) cin >> a[i];
    solve();
  }
  return 0;
}
