import std.stdio;void main(){char[9999]s;for(int i,j,k;gets=&s[i+=50],putchar=!~s[j+=50]?j=++k,10:s[j];){}}