a,b;char*c,d[99];main(i,j){gets(c=&j);while(gets(d))puts(c);for(;d[++b]!='K';);for(;c[++b]!=84;)++c[b];puts(c);}