#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n * 2];
    for (int i = 0; i < n * 2; i++) {
      cin >> a[i];
    }
    int b[n + 1];
    b[0] = a[0];
    int count = 0, temp = 0;
    for (int i = 1; i < n * 2; i++) {
      for (int j = 0; j < i; j++) {
        if (a[i] == a[j]) {
          count = 1;
          break;
        }
      }
      if (count == 0) {
        temp++;
        b[temp] = a[i];
      }
      count = 0;
      if (temp + 1 == n) {
        break;
      }
    }
    for (int i = 0; i < n; i++) {
      cout << b[i] << " ";
    }
    cout << endl;
  }
}
