#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct input{


        char *str;
       struct  input* link;
}input;
void main(){
       
        input *head;
        input *n;
        input *flag;
        char s[20]; char q[20];
        char *p;
        head = (input*)malloc(sizeof(input));
        p=s;
        gets(p);


        head->str = p;
        head->link = NULL;
        flag = head;

 


        p=q;
        gets(p);


       n = (input*)malloc(sizeof(input));


        n->link =NULL;
        n->str = q;
        flag->link = n;
     
  printf(\"%s\\n\",flag->str);
  printf(\"%s\\n\",flag->link->str);
}