rept :: Int -> Int -> (a,a) -> [a]
rept n i dt@(a,b)
  | i > n = []
  | (mod i 2) == 1 = a : rept n (i + 1) dt
  | otherwise = b : rept n (i + 1) dt

makeFrame :: Int -> Int -> [String]
makeFrame h w = rept h 1 (fstl,scdl)
  where 
    fstl = rept w 1 ('#','.')
    scdl = rept w 1 ('.','#')

main = do
  contents <- getContents
  let
    dat = takeWhile (/= [0,0])
      $ map (map (read :: String -> Int))
      $ map words
      $ lines contents
    ansList = map (\[h,w] -> makeFrame h w) dat
  mapM_ (putStrLn . unlines) ansList
