442. Merge Two Sorted Arrays

0

Easy

Given two sorted integer arrays arr1 and arr2, along with two integers m and n representing the number of elements in arr1 and arr2 respectively, merge arr1 and arr2 into a single array sorted in non-decreasing order.

Input Format

The first line contains two space-separated integers m and n respectively.

The next two lines consist of arr1 and arr2 respectively.

The next two lines consist of arr1 and arr2 respectively.

Output Format

Print the merged sorted array in a single line.

Example

Input

4 5
1 2 4 9
3 5 6 8 10

Output

1 2 3 4 5 6 8 9 10

Constraints

1 <= n,m <=10^5

-10^5 <= arr1[i] , arr2[i] <= 10^5

-10^5 <= arr1[i] , arr2[i] <= 10^5

Loading...

View Submissions

Console