#include #include using namespace std; int main() { int n, m; cin >> n; set sortedUnion; for (int i = 0; i < n; i++) { int num; cin >> num; sortedUnion.insert(num); } cin >> m; for (int i = 0; i < m; i++) { int num; cin >> num; sortedUnion.insert(num); } for (int num : sortedUnion) { cout << num << " "; } return 0; }