object PrintARectangle {
  def inputScanner: (Int, Int) = {
    val sc = new java.util.Scanner(System.in)
    val n, m = sc.nextInt
    (n, m)
  }
  def printRectangle ( a:(Int, Int) ):Unit = {
    val (x, y) = a
    val s = "".padTo(x, '#')
    for (i <- 0 until y) println(s)
  }
  def run():Unit = {
    var a = inputScanner
    var (x, y) = a
    while ( x != 0 || y != 0) {
      printRectangle(a)
      a = inputScanner
      (x, y) = a
    }
  }
}
object Main {


  def main(args: Array[String]) {
    PrintARectangle.run()
  }
}