#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> permutation;
vector<int> answer;
set<int> seen;
void In() {
  permutation.clear();
  answer.clear();
  seen.clear();
  cin >> n;
  permutation.resize(2 * n);
  for (int i = 0; i < 2 * n; i++) cin >> permutation[i];
}
void Solve() {
  for (int i = 0; i < 2 * n; i++) {
    if (seen.count(permutation[i])) continue;
    seen.insert(permutation[i]);
    answer.push_back(permutation[i]);
  }
}
void Out() {
  for (int res : answer) cout << res << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    In();
    Solve();
    Out();
  }
}
