d=io.read f=d(51)l,c=d'*a':gsub(' *\n','')print(f:rep(c)..l..f.rep(0,f:find"T"-#l))