fun main(args: Array<String>) {
    while (true) {
        val inStr = readLine()
        val (h, w) = inStr?.split(' ')?.map { s -> s.toInt() } ?: return

        if ((h == 0) && (w == 0)) {
            return
        }
        printRectangle(h, w)
    }
}

fun printRectangle(height:Int, width:Int) {
    val line = "#".repeat(width)
    val rectAngle = (line + "\n").repeat(height)
    println(rectAngle)
}

