import scala.io.StdIn.readLine

object Main {
  def main(args: Array[String]) {
    def printRectangle: Unit = {
      val Array(a, b) = readLine().split(" ").map(_.toInt)
      if(a != 0 || b != 0) {
        for(i <- 0 until a) {
          println("#" * b)
        }

        println()
        printRectangle
      }
    }

    printRectangle
  }
}