#include <iostream>
#include <string> //字符串;
#include <sstream> //流;
using namespace std ;
int main ( ) {
string s1 ,s2 ,s3 ,s4 ; //定义字符串;
cin >> s1 ; //输入s1,输入一串,不包括空格和换行;
getline( cin ,s1 ); //清除缓冲区;
getline( cin ,s1 ); //输入s1,输入一排,包括空格;
getline( cin ,s2 ,'a' ); //输入s2,不断输入直到输入a(包括空格和换行);
s3 = s1+s2 ; //将s2接在s1后面赋给s3;
if (s1>s2); //比较s1和s2的字典序的大小;
getline( cin ,s4 );
stringstream ss( s4 ); //将s4转化为流ss;
ss >> s1 >> s2 ; //将ss赋给s1,s2(以逗号或换行为间隔),类比于cin;
cout << s1 << endl << s2 << endl << s3 << endl << s4 << endl ;
return 0 ;
}