#include <iostream>
#include <map>
using namespace std;
const int N = 100010;
int main(){
int t;
scanf("%d", &t);
while (t--){
int n;
scanf("%d", &n);
map<int, int> mp;
for (int i = 1; i <= n; i++){
int x;
scanf("%d", &x);
mp[x] ++;
if (mp[x] == 1) cout<<x<<' ';
}
cout<<endl;
}
}