#include <bits/stdc++.h>
using namespace std;
void remove(vector<int> &v) {
  auto end = v.end();
  for (auto it = v.begin(); it != end; ++it) {
    end = remove(it + 1, end, *it);
  }
  v.erase(end, v.end());
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n;
    vector<int> v;
    for (long long i = 0; i < 2 * n; i++) {
      cin >> x;
      v.push_back(x);
    }
    remove(v);
    for (auto it = v.begin(); it != v.end(); ++it) {
      cout << *it << ' ';
    }
    cout << endl;
  }
}
