import java.util.Scanner

/**
  * Created by ui on 2016/02/07.
  */
object PrintARectangle3 {


  def inputHW (s:Scanner)= {
    val h = s.nextInt
    val w = s.nextInt
    (h,w)
  }
  def printRectangle (x:Int, y:Int): Unit = {
    val s = "".padTo(x, '#')
    for (i <- 0 until y) println(s)
    println
  }
  def run: Unit = {

    val sc: Scanner = new java.util.Scanner(System.in)
    var a = inputHW(sc)
    var h = a._1
    var w = a._2
    while (h != 0 || w != 0) {
    printRectangle(w,h)
      a = inputHW(sc)
      h = a._1
      w = a._2
    }
  }
}
/**
  * Created by ui on 2016/02/04.
  */
object Main {
  def main(args: Array[String]): Unit = {
    PrintARectangle3.run
  }
}