#include <stdio.h>
#include <stdlib.h>
#include<string.h>
struct node {
    char data[100];
    struct node *next;
};

int main() {
    int n, i;
    struct node *start = NULL;
    struct node *temp = NULL;
    struct node *current = NULL;
    printf(" ");
    scanf("%d", &n);
    start = (struct node *)malloc(sizeof(struct node));
    printf(" ");
    scanf("%s", start->data);
    start->next = NULL;
    current = start;
    for (i = 2; i <= n; i++) {
        temp = (struct node *)malloc(sizeof(struct node));
        printf(" ", i);
        scanf("%s", temp->data);
        temp->next = NULL;
        current->next = temp;
        current = temp;
    } 
    printf("\n");
    current = start;
    while (current != NULL) {
        printf("%s ", current->data);
        current = current->next;
    }

    return 0;
}