#include <stdio.h>
int main()
{
    int n  =  0;
    scanf("%d",&n);
    int arr[100];
    int i,j = 0;
    for(i=1;i<n+1;i++)
    {
        scanf("%d",&arr[i]);
    }
    int k = 0;
    scanf("%d",&k);
    arr[0] = k;
    for(j=1;j<n+1;j++)
    {
        for(i=0;i<n+1-j;i++)
        {
            if(arr[i+1]<arr[i])
            {
                int mid = 0;
                mid = arr[i];
                arr[i] = arr[i+1];
                arr[i+1] = mid;
            }
        }
    }
    for(i=0;i<n+1;i++)
    {
        printf("%d ",arr[i]);
    }
    return 0;
}