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