#include <iostream>
#include <string>
using namespace std;
int main(){
string s,s1,s2;
int i = 0;
string str[100];
while (cin >> s){
str[i] = s;
cout << s << endl;
i++;
}
int j;
for (j = 0; j <= i;j++){
s1 = s1 + str[j];
s2 = s2 + str[j]+" ";
}
cout << s1 << endl<<s2<<endl;
return 0;
}