// editor1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.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;
    scanf("%d", &n);
    if (n < 1 || n > 1000) 
    {
        printf("Invalid input");
        return 0;
    }
    start = (struct node *)malloc(sizeof(struct node));
    scanf("%s", start->data);
    for (i = 0; start->data[i] != '\0'; i++)
    {
        if (!isalnum(start->data[i]))
        {
            printf("Invalid input");
            return 0;
        }
    }
    start->next = NULL;
    current = start;
    for (i = 2; i <= n; i++)
    {
        temp = (struct node *)malloc(sizeof(struct node));
        scanf("%s", temp->data);
        for (int j = 0; temp->data[j] != '\0'; j++)
        {
            if (!isalnum(temp->data[j]))
            {
                printf("Invalid input");
                return 0;
            }
        }
        temp->next = NULL;
        current->next = temp;
        current = temp;
    }
    current = start;
    while (current != NULL) 
    {
        printf("%s", current->data);
        if (current->next != NULL)
        {
        current = current->next;
        }
    }
    return 0;
}