// #include <stdio.h>
// #include <stdlib.h>
// #include <ctype.h>
// #include <string.h>

// typedef struct Node {
//     int data;
//     struct Node *next;
// } Node;

// Node* createNode(int value) {
//     Node* newNode = (Node*)malloc(sizeof(Node));
//     newNode->data = value;
//     newNode->next = NULL;
//     return newNode;
// }

// int isNumber(char *str) {
//     int i = 0;
//     if (str[0] == '-') 
//         i = 1;

//     if (str[i] == '\0')
//         return 0;

//     for (; i < strlen(str); i++) {
//         if (!isdigit(str[i]))
//             return 0;
//     }
//     return 1;
// }

// int main() {
//     int n;
//     scanf("%d", &n);

//     if (n < 1 || n > 1000) {
//         printf("Invalid input");
//         return 0;
//     }

//     Node *head = NULL;
//     for (int i = 0; i < n; i++) {
//         char input[50];
//         scanf("%s", input);

//         if (!isNumber(input)) {
//             printf("Invalid input");
//             return 0;
//         }

//         int value = atoi(input);
//         Node* newNode = createNode(value);

//         newNode->next = head;
//         head = newNode;
//     }

//     Node *temp = head;
//     while (temp != NULL) {
//         printf("%d ", temp->data);
//         temp = temp->next;
//     }
//     return 0;
// }
#include<stdio.h>
#include<stdlib.h>
 struct node{
     int data;
     struct node*next;
 }*head=NULL,*tail;
int main(){
    int k;
    scanf("%d",&k);
    if(nk==0){
        printf("List is empty");
    }
    
    else if(n-k<0{
        printf("Invalid input")
    }
    
    else{
        struct node*temp=head;
        for(i=0;<n-k;i++){
            temp=temp->next;
        }
        struct node*t=temp;
        temp=temp->next;
        while(temp){
           struct node*x=temp;
           temp=temp->next;
           free(x);
        }
        
        while(head){
            printf("%d",head->data);
            head=head->next;
        }
        
    }
    
    return 0;
}