#include<iostream>
using namespace std;
struct stu
{char name[12];
struct stu *next;
};
int main()
{struct stu *head,*p;
head=new stu;
cin>>head->name;
p=head->next=new stu;
cin>>p->name;
p->next=NULL;
cout<<head->name<<endl;
cout<<p->name<<endl;
return 0;
}