i=input().find('T') while 1: print(' '*i+'*') d=input().find('K') if!~d:-print(' '*d+'*'*(i-d+1))