#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    structnode* next;
}*head=NULL,*tail;
int main()
{
    int k;
    scanf("%d",&k);
    if(n-k==0)
    printf("List is empty");
    elseif(n-k<0)
    printf("Invalid input");
    else
{
    structnode*temp=head;
    for(i=0;i<n;i++)
{
    temp=temp->nextl;
}
structnode*temp*t=temp;
temp=temp->next;
while(temp)
{
    struct node*x=temp;
    temp=temp->next;
    free(x);
}
t->next=NULL;
while(head)
{
    printf("%d",head->data);
    head=head->next;
       }
     }
   }