#include <bits/stdc++.h>
using namespace std;
const int MAX = 0x7ffffff;
int t;
void slove() {
  int n;
  cin >> n;
  vector<int> b;
  vector<bool> vis(n + 1, 0);
  int x = 0;
  for (int i = 0; i < 2 * n; i++) {
    cin >> x;
    if (!vis[x]) {
      vis[x] = 1;
      b.push_back(x);
    }
  }
  for (int i = 0; i < b.size(); i++) {
    cout << b[i] << " ";
  }
  cout << endl;
}
int main() {
  std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> t;
  while (t--) {
    slove();
  }
}
