import scala.util.control.Breaks
object Main extends App {
  val b = new Breaks()
  b.breakable {
    while (true) {
      val Seq(h, w) = readLine().split(' ').map(_.toInt).toList

      if ((h, w) == (0, 0)) b.break

      println((("#" * w)  + '\n') * h)
    }
  }
}
