i=input().find('T') d=-1 while 1:print(['*'*(i-d+1),'*'][d<0].rjust(i+1));d=input().find('K')