object Main extends App {
  val sc = new java.util.Scanner(System.in)
  print(sc.nextInt, sc.nextInt)

  def print(h: Int, w: Int): Unit = {
    (h, w) match {
      case (0, 0) => sc.close()
      case _ => {
        for (i <- 1 to h) {
          println("#" * w)
        }
        println()
        print(sc.nextInt(), sc.nextInt())
      }
    }
  }
}