#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
int n;
int a, sum = 0;
cin >> a;
for (int sum = 0; sum < a; sum++) {
cin >> n;
int aaa = 0;
for (int i = 1; i <= n; i++) {
long long aa;
cin >> aa;
if (!mp.count(aa) || (mp[aa] != sum)) {
if (aaa == 0) {
aaa = 1;
} else {
cout << " ";
}
cout << aa;
mp[aa] = sum;
}
}
cout << endl;
}
return 0;
}
爆TLE了