int main()
{
    //输入一个整数
    int i = 0;
    scanf("%d",&i);
    //输入整数数组
    int arr[51] = {0};
    int a = 0;
    for (a = 0;a < i;a++)
    {
        scanf("%d",&arr[a]);
    }
    //插入的数
    int b = 0;
    scanf("%d",&b);
    //插入数
    int c = i;
    while(c--)
    {
        if(arr[c] > b)
        {
            arr[c+1] = arr[c];
            arr[c] = b;
        }
        else 
        {
            arr[c+1] = b;
            break;
        }
    }
    //打印数组
    for (a = 0; a < i+1 ;a++)
    {
        printf("%d ",arr[a]);
    }
    return 0;
}