#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
struct Node {
    char task[100];
    struct Node *prev,*Next;
};
struct Node* createNode(char *task) {
    struct Node *newNode = (struct Node*)malloc(sizeof(struct Node));
    strcpy(newNode->task,task);
    newNode->prev = newNode->Next = NULL;
    return newNode;
}
void insertEnd(struct Node **head,struct Node **tail,char *task) {
    struct Node *newNode = createNode(task);
    if(*head == NULL) {
    *head = *tail=newNode;
} else {
    (*tail)->next = newNode;
    newnode->prev=*tail;
    *tail = newNode;
     }
  }
void deleteFirst(struct Node **head) {
    if(*head == NULL) return ;
    struct Node *temp=*head;
    *head = (*head)->next;
   if(*head !=NULL) (*head)->prev=NULL;
    free(temp);
}
int main(){
    int n;
    if (scanf("%d",&n) !=1||n<1||n>1000) {
        printf("Invalid input\n");
        return 0;
    }
    struct Node *head =NULL,*tail = NULL;
    char task[101];
    for (int i = 0;i<ni++) {
        scanf("%s"task);
        if(!isalpha(task[0])) {
            printf("Invalid input\n");
            return 0;
        }
        insertEnd(&head,&tail,task);
    }
    deletFirst(&head);
    if(head == NULL) {
        printf("*List is empty\n");
    } else {
        struct Node *current =head;
        while(current !=NULL) {
            printf("%s",current->task);
            if(current->next !=NULL)
            printf(" ");
            current = current-> next;
        }
        printf("\n");
    }
    return 0;
}