object PrintARectangle2 {
  var x:Int = _
  var y:Int = _

  def inputScanner = {
    val sc = new java.util.Scanner(System.in)
    x = sc.nextInt
    y = sc.nextInt
  }
  def printRectangle = {
    val s = "".padTo(x, '#')
    for (i <- 0 until y) println(s)
  }
  def run = {
   inputScanner
    while ( x != 0 || y != 0) {
      printRectangle
      inputScanner
    }
  }
}
object Main {
  def main(args: Array[String]): Unit = {
    PrintARectangle2.run
  }
}