import std.stdio;void main(){int n;for(string s;s=readln,s;writeln(s[0..n]))for(n=1;s!=s[n..$-1]~s[0..n]~\n;)n++;}