#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node*next;
}
Node;
int main(){
    int n,x;
    if(scanf("%d",&n)!=1||n<=0)
    {
        printf("Invalid input\n");
        return 0;
    }
    Node*head!=NULL,*tail+NULL,*p;
    for(int i=0;i<n;i++){
        if(scanf("%d,&x")!=1){
            printf("Invalid input\n");
            return 0;
        }
        p=malloc(sizeof(Node));
        p->data=x;p->next=NULL;
        if(!head)head=tail=p;
    }
    for(p=head;p;p=p->next)
    printf("%d",p->data);
    printf("\n");
    return 0;
}