#include<stdio.h>
int main()
{
int a=0, b;
scanf("%d%d", &a, &b);
//scanf("%a%b", &a, &b);
int arr[20] = { 0 };
int arr2[20] = { 0 };
for (int i = 0; i < a; i++)
{
scanf("%d", &arr[i]);
}
for (int i = 0; i < b; i++)
{
scanf("%d", &arr2[i]);
}
int arr3[40] = { 0 };int m = 0;
for (int i = 0; i < a + b; i++)
{
if (i < a)
{
arr3[i] = arr[i];
m = i+1;
}
else
arr3[i] = arr2[i - m];
}
//冒泡排序
for (int i = 0; i < a + b - 1; i++)
{
for (int m = 0; m < a + b - 1-i; m++)
{
if (arr3[m] > arr3[m+1])
{
int t = 0;
t = arr3[m + 1];
arr3[m + 1] = arr3[m];
arr3[m] = t;
}
}
}
for (int i = 0; i < a + b; i++)
{
printf("%d ", arr3[i]);
}
return 0;
}
int main()
{
int a=0, b;
scanf("%d%d", &a, &b);
//scanf("%a%b", &a, &b);
int arr[20] = { 0 };
int arr2[20] = { 0 };
for (int i = 0; i < a; i++)
{
scanf("%d", &arr[i]);
}
for (int i = 0; i < b; i++)
{
scanf("%d", &arr2[i]);
}
int arr3[40] = { 0 };int m = 0;
for (int i = 0; i < a + b; i++)
{
if (i < a)
{
arr3[i] = arr[i];
m = i+1;
}
else
arr3[i] = arr2[i - m];
}
//冒泡排序
for (int i = 0; i < a + b - 1; i++)
{
for (int m = 0; m < a + b - 1-i; m++)
{
if (arr3[m] > arr3[m+1])
{
int t = 0;
t = arr3[m + 1];
arr3[m + 1] = arr3[m];
arr3[m] = t;
}
}
}
for (int i = 0; i < a + b; i++)
{
printf("%d ", arr3[i]);
}
return 0;
}