#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
int arr[200];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    map<int, bool> mapa;
    vector<int> r;
    for (int i = 0; i < 2 * n; i++) {
      int val;
      cin >> val;
      if (!mapa[val]) {
        mapa[val] = true;
        r.push_back(val);
      }
    }
    for (int i = 0; i < r.size(); i++) {
      if (!i)
        cout << r[i];
      else
        cout << " " << r[i];
    }
    cout << '\n';
  }
  return 0;
}
