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