printLine n m
  | n == 0 = "\n"
  | n > 1 && n < m = "." ++ printLine (n - 1) m
  | otherwise = "#" ++ printLine (n - 1) m

printLineW n
  | n == 0 = "\n"
  | otherwise = "#" ++ printLineW (n - 1)

printRect h hh w
  | h == 0 = ""
  | h > 1 && h < hh = printLine w w ++ printRect (h - 1) hh w
  | otherwise = printLineW w ++ printRect (h - 1) hh w

main = do
  hw <- getLine
  if hw == "0 0"
    then
      return []
    else do
      let lhw = map (read :: String -> Int) $ words hw
      putStrLn $ printRect (lhw !! 0) (lhw !! 0) (lhw !! 1)
      main