import io.Source.stdin

object Main {

  def main(args: Array[String]) {
    for ((list) <- stdin.getLines().takeWhile(_ != "0 0").map(_.split(" ").map(_.toInt))) {
      val (w: Int, h: Int) = (list(0), list(1))
      printRect(w, h)
    }
  }

  def printRect(w: Int, h: Int) {
    for (i <- 1 to w) {
      for (j <- 1 to h) {
        print("#")
      }
      println()
    }
    println()
  }
}

