import scala.io.StdIn.readLine

object Main extends App {

  for (_ <- 1 to 300) {
    val input = readLine.split(" ").map(_.toInt)
    val (h, w) = (input(0), input(1))

    if (h == 0 && w == 0) sys.exit() else {
      for (e <- 1 to h) {
        println("#" * w)
      }
      println()
    }
  }

}

