#include #include int main() { int n, m; std::set unionSet; // Input first array std::cin >> n; for (int i = 0; i < n; ++i) { int num; std::cin >> num; unionSet.insert(num); } // Input second array std::cin >> m; for (int i = 0; i < m; ++i) { int num; std::cin >> num; unionSet.insert(num); } // Output union in ascending order for (int num : unionSet) { std::cout << num; } std::cout << std::endl; return 0; }