import scala.io.StdIn

/**
  * AOJ
  */
object Main {

  def main(args: Array[String]): Unit = {

    while(true) {
      val in = StdIn.readLine().split(" ").map(_.toInt)
      if(in(0) == 0 && in(1) == 0) return
      for(i <- 1 to in(0)){println("#" * in(1))}
      println()
    }
  }
}