#define W(x,y)x:=y[2..16]+y[1]+^j; var s,t,u,v:string;begin readln(s);readln(t);read(u);repeat v:=s;W(s,t)W(t,u)W(u,v)writeln(s+t+u)until^,=u[5]end.