fun main(args: Array<String>) {
    var (h, w) = readLine()!!.split(" ").map { it.toInt() }
    while(h != 0 || w != 0) {
        if (h != 0 && w != 0) {
            val wide = "#".times(w)
            for (i in 0 until h) {
                println(wide)
            }
        }
        println("")
        val (h2, w2) = readLine()!!.split(" ").map { it.toInt() }
        h = h2
        w = w2
    }
}

private operator fun String.times(num: Int): String {
    var s = ""
    for (i in 0 until num) s += this
    return s
}




