#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  bool vis[55];
  memset(vis, false, sizeof(vis));
  vector<int> ans;
  for (int i = 0; i < 2 * n; i++) {
    int temp;
    cin >> temp;
    if (!vis[temp]) {
      vis[temp] = true;
      ans.push_back(temp);
    }
  }
  for (auto item : ans) {
    cout << item << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
