object PrintARectangle {
  def inputScanner = {
    val sc = new java.util.Scanner(System.in)
    val n, m = sc.nextInt
    (n, m)
  }
  def printRectangle ( a:(Int, Int) ) {
    val s = "".padTo(a._1, '#')
    for (i <- 0 until a._2) println(s)
  }
  def run() {
    var a = inputScanner
    while ( a != (0, 0)) {
      printRectangle(a)
      a = inputScanner
    }
  }
}
object Main {
  def main(args: Array[String]) {
    PrintARectangle.run()
  }
}