// editor2
#include <stdio.h>
#include <string.h>

int main() {
    int n, pos;
    scanf("%d", &n);

    char chapters[n][50];  // assuming max chapter name length = 49 chars
    for (int i = 0; i < n; i++) {
        scanf("%s", chapters[i]);
    }

    scanf("%d", &pos);

    // Check for invalid position
    if (pos < 0 || pos >= n) {
        printf("Invalid input");
        return 0;
    }

    // Remove the chapter at position pos
    for (int i = pos; i < n - 1; i++) {
        strcpy(chapters[i], chapters[i + 1]);
    }
    n--;

    // If list becomes empty
    if (n == 0) {
        printf("List is empty");
        return 0;
    }

    // Print updated list
    for (int i = 0; i < n; i++) {
        printf("%s", chapters[i]);
        if (i < n - 1) printf(" ");
    }

    return 0;
}'