#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < 2 * n; i++) {
      int a;
      cin >> a;
      if (find(v.begin(), v.end(), a) != v.end())
        continue;
      else
        v.push_back(a);
    }
    for (int i = 0; i < n; i++) cout << v[i] << " ";
    cout << "\n";
  }
  return 0;
}
