#include <bits/stdc++.h>
using namespace std;
int xx[4] = {0, 0, 1, -1};
int yy[4] = {1, -1, 0, 0};
int main() {
  long long t;
  scanf("%lld", &t);
  while (t--) {
    long long n;
    scanf("%lld", &n);
    map<long long, long long> mp;
    for (int i = 0; i < n * 2; i++) {
      long long x;
      scanf("%lld", &x);
      if (mp[x] == 0) {
        mp[x] = 1;
        cout << x << " ";
      }
    }
    cout << endl;
  }
}
