#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int p = 0; p < t; p++) {
    int n;
    cin >> n;
    int a[2 * n];
    for (int i = 0; i < 2 * n; i++) {
      cin >> a[i];
    }
    int ans[n];
    int x = 0;
    for (int i = 0; i < 2 * n; i++) {
      int y = 0;
      for (int j = 0; j < i; j++) {
        if (a[j] == a[i]) {
          y = 1;
          break;
        }
      }
      if (y == 0) {
        ans[x] = a[i];
        x++;
      }
      if (x == n) {
        break;
      }
    }
    for (int i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
}
