#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    struct node*next;
};
struct node* createnode(int value){
    struct node*newnode =(struct node*)malloc(size of struct (node));
    newnode->data=value;
    newnode->next=NULL;
    return newnode;
}
void deletelastk(struct node** head,int k){
    int len =0;
    struct node*temp=*head;
    while (temp!=NULL){
        len++;
        temp=temp->next;
    }
    if(k >len){
        printf("Invalid input\n");
        return ;
    }
    if(k== len){
        printf("List iss empty\n");
        return ;
    }
    int stop =len -k;
    temp=*head;
    for(int i=1;i<stop;i++){
        temp=teemp->next;
    }
    struct node*del =temp->next;
    temp->next=NULL;
    while (del !=NULL){
        struct node*t = del;
        del=del->next;
        free(t);
        
    }
    temp=*head;
    while(temp !=NULL){
        printf("%d", temp->data);
        if(temp->next!= NULL)printf(" ");
        temp temp->next
    }
    printf("\n");
}
int main()
  int n;
  scanf("%d",&n);
  struct node*head=NULL;
  struct node*tail=NULL;
  for(int i=0;i<n;i++){
      int id;
      scanf("%d",&id);
      struct node*newnode=createnode(id);
      if(head == NULL)
      head =newnode;
      tail =newnode;
}else {
    tail ->next=newnode;
    tail = newnode;
}
}
 
int k;
scanf("%d",&k);
if (head->next==NULL && K ==1) {
    printf("List is empty\n");
    return 0;
}