#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int t, n;
bool used[55];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> ans;
    fill(used, used + 55, false);
    for (int i = 0, x; i < 2 * n; ++i) {
      cin >> x;
      if (!used[x]) {
        ans.push_back(x);
      }
      used[x] = true;
    }
    for (auto x : ans) {
      cout << x << ' ';
    }
    cout << endl;
  }
  return 0;
}
