#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int i=0;
    int m=0;
    int count=0;
    vector <int> a;
    vector <int> b;
    while(cin>>m)
    {
        if(count==0)
        {
            a.push_back(m);
        }
        else 
        {
            b.push_back(m);
        }
        if(getchar()=='\n')
        {
            count=1;
        }
    }
    int len1=a.size();
    int len2=b.size();
    int x=0;
    int y=0;
    for(i=0;i<len1+len2;i++)
    {
        if(x<len1  &&  y<len2)
        {
            if(a[x]<=b[y])
            {
                cout<<a[x];
                x++;
            }
            else 
            {
                cout<<b[y];
                y++;
            }
        }
        else 
        {
            if(x>=len1)
            {
                cout<<b[y];
                y++;
            }
            else 
            {
                cout<<a[x];
                x++;
            }
        }
        if(i!=len1+len2-1)
        {
            cout<<" ";
        }
    }
    return 0;
}