#include<stdio.h>
int main()
{
    int n,i,num,pos;
    scanf("%d",&n);
    int arr[n];
    for (i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    printf("Enter element to insert : ");
    scanf("%d",&num);
    printf("Enter the element position : ");
    scanf("%d",&pos);
    if (pos>n+1 || pos<=0)
    {
        printf("Invalid");
    }
    else
    {
        for (i=n;i>=pos;i--)
        {
            arr[i]=arr[i-1];
        }
        arr[pos-1]=num;
         n++;
        for(i=0; i<n; i++)
        {
            printf("%d\t",arr[i]);
        }
    }
    }