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