var s,t:string(999);begin repeat readln(t);t:=t+^j;insert(t,s,pos(t,s+t))until eof;write(s)end.