#include <bits/stdc++.h>
void ReadTest(std::vector<int>& merged) {
  int n;
  std::cin >> n;
  merged.resize(2 * n);
  for (int& i : merged) {
    std::cin >> i;
  }
}
void PrintPerm(const std::vector<int>& perm) {
  for (int i : perm) std::cout << i << " ";
  std::cout << std::endl;
}
void SolveTest(const std::vector<int>& merged) {
  std::set<int> s;
  std::vector<int> perm;
  perm.reserve(50);
  for (int i : merged) {
    if (s.find(i) == s.end()) {
      perm.push_back(i);
      s.insert(i);
    }
  }
  PrintPerm(perm);
}
int main() {
  int n;
  std::cin >> n;
  std::vector<int> mergedPerm;
  mergedPerm.reserve(50);
  for (int i = 0; i < n; i++) {
    ReadTest(mergedPerm);
    SolveTest(mergedPerm);
    mergedPerm.clear();
  }
}
