/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_5_A
  * Structured Program I - Print a Rectangle
  */
object Main {
  def main(args: Array[String]): Unit = {
    Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).map(_.split(" ").map(_.toInt)).map { case Array(h, w) => (h, w) }
      .takeWhile(_ != (0, 0))
      .map { case (h, w) => createARectangle(h, w) }
      .foreach(_.foreach(println))
  }

  def createARectangle(h: Int, w: Int): Seq[String] = {
    (1 to h).map(_ => "#" * w) :+ ""
  }
}