420. 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 two parts. The first part contains an integer N, representing the size of the first array. The second part contains N space-separated integers, representing the elements of the first array. The third part contains an integer M, representing the size of the second array. The fourth part 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