#include #include #include #include using namespace std; int main() { int n, m; cin >> n; vector arr1(n); for (int i = 0; i < n; ++i) { cin >> arr1[i]; } cin >> m; vector arr2(m); for (int i = 0; i < m; ++i) { cin >> arr2[i]; } set uniqueElements; for (int num : arr1) { uniqueElements.insert(num); } for (int num : arr2) { uniqueElements.insert(num); } vector result(uniqueElements.begin(), uniqueElements.end()); sort(result.begin(), result.end()); for (int num : result) { cout << num << " "; } cout << endl; return 0; }