813. Array Merge

0

Easy

Given two sorted arrays of sizes n and m, the task is to merge them into a single sorted array of size n + m.

Input Format

The input consists of the following:
- The first line contains an integer N, representing the size of the first array.
- The second line contains N space-separated integers, representing the elements of the first array.
- The third line contains an integer M, representing the size of the second array.
- The fourth line contains M space-separated integers, representing the elements of the second array.

Output Format

Output a single line containing the merged array of size N + M, sorted in ascending order.

Example

Input

5
7 8 9 10 11
4
1 2 3 4

Output

1 2 3 4 7 8 9 10 11

Constraints

1 <= N, M <= 100

10^-9 <= arr[i] <= 10^9

10^-9 <= arr[i] <= 10^9

Loading...

View Submissions

Console