import System.IO
left s1 s2 = [(c1:s1,c2:s2)| c1<-".#",c2<-".#"]
right s1 s2 = [(s1++[c1],s2++[c2])| c1<-".#",c2<-".#"]
outer f s1 s2 = do
  let inner [] = outer right s1 s2
      inner ((s1,s2):ss) = do
        putStrLn s1
        putStrLn s2
        hFlush stdout
        r <- getLine
        case r of
          "end" -> return ()
          "T" -> outer f s1 s2
          "F" -> inner ss
  inner $ f s1 s2
main = do
  getLine
  outer left "" ""