object Main {
  def main(args:Array[String]): Unit = {
    Iterator.continually(readLine())
      .map(s => {
        val xs = s.split(" ").map(_.toInt) 
        (xs(0), xs(1))
      })
      .takeWhile{
        case (0, 0) => false
        case _ => true
      }
      .foreach(xs => {
        val res = printRepeat(1 to xs._1)(printRepeat(1 to xs._2)("#") + "\n")
        println(res)
      })
  }
  
  def printRepeat(r:Range)(s:String): String = {
    r.foldLeft("")((a, _) => a + s )
  }
}