/**
  * Created by ui on 2016/02/04.
  */
object Main {
  def main(args: Array[String]): Unit = {
    PrintARectangle2.run



  }
  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
      }
    }
  }
}