#include using namespace std; int main() { int len1, len2; cin >> len1; int array1[4]; for (int i = 0; i < len1; i++) { cin >> array1[i]; } cin >> len2; int array2[5]; for (int i = 0; i < len2; i++) { cin >> array2[i]; } int merged[9]; for (int i = 0; i < len1; i++) { merged[i] = array1[i]; } for (int i = 0; i < len2; i++) { merged[len1 + i] = array2[i]; } for (int i = 0; i < (len1 + len2) - 1; i++) { for (int j = 0; j < (len1 + len2) - i - 1; j++) { if (merged[j] > merged[j + 1]) { int temp = merged[j]; merged[j] = merged[j + 1]; merged[j + 1] = temp; } } } for (int i = 0; i < len1 + len2; i++) { cout << merged[i] << " "; } cout << endl; return 0; }