import scala.io.StdIn.readLine

object Main extends App {

  val lines = Iterator.continually(readLine())
  val xs = {
    val xs = for {
      line       <- lines
      Array(h, w) = line.split(" ").map { _.toInt }
    } yield (h, w)

    xs.takeWhile { _ != (0, 0) }
  }

  for {
    rows <- xs.map(solve)
  } {
    rows.foreach(println)
    println()
  }

  def solve(pair: (Int, Int)): Iterator[String] = pair match {
    case (h, w) =>
      val row  = Iterator.fill(w)('#').mkString("")
      val rows = Iterator.fill(h)(row)
      rows
  }
}

