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