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