#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << showpoint;
  cout << setprecision(11);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int ar[2 * n];
    for (auto ii = 0; ii != 2 * n; ii++) cin >> ar[ii];
    int vis[2 * n];
    memset(vis, 0, sizeof(vis));
    vector<int> ans;
    int i = 0;
    while (i < 2 * n) {
      if (vis[i] == 0) {
        ans.push_back(ar[i]);
        vis[i] = 1;
        for (int j = 0; j < 2 * n; j++) {
          if (ar[j] == ar[i] && vis[j] == 0) {
            vis[j] = 1;
          }
        }
      }
      i++;
    }
    for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
    cout << "\n";
  }
  return 0;
}
