#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(2 * n);
  vector<int> s;
  for (long long int i = 0; i < 2 * n; i++) cin >> v[i];
  for (long long int i = 0; i < 2 * n; i++) {
    if (find(s.begin(), s.end(), v[i]) == s.end()) {
      s.push_back(v[i]);
    }
  }
  for (auto i : s) cout << i << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
