i=input().find('T') while 1: print(' '*i+'*') d=input().find('K') if d>=0:print(' '*d+'*'*(i-d+1));1/0