import scala.collection.mutable.ListBuffer
import scala.io.StdIn

object Main extends App {

  var temp = Array(-1, -1)
  val buff = new ListBuffer[(Int, Int)]
  while(temp(0) != 0 && temp(1) != 0){
    temp = StdIn.readLine().split(' ').map(_.toInt)
    buff += ((temp(0), temp(1)))
  }

  val result = buff.dropRight(1).map { case (h, w) =>
    (0 until h).map { _ =>
      Array.fill(w)("#").mkString("")
    }.mkString(f"%n")
  }
  println(result.mkString(f"%n"))
}

