#include<stdio.h> #include<stdlib.h> typedef struct num { int num; struct num* next; }link; link* create(int n) { link*head,*node,*now; head =malloc(sizeof(link)); now=head; for(int i=1;i<=n;i++) { node=(link*)malloc(sizeof(link)); scanf("%d",&node->num); now->next=node; now=node; } return head; } void insert(int x, link* a) { link* insert; link* node=a; for(int i=1;i<=x;i++) { node=node->next; } insert =(link*)malloc(sizeof(link*)); insert->num =x; insert->next=node->next; node->next=insert; } void show(link*a,int n) { link*node =a->next; while(node!=NULL) { printf("%d ",node->num); node=node->next; } } int main() { int n,x; scanf("%d%d",&n,&x); link*a= create(n); insert(x,a); show(a,n); return 0; }