import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    while (true) {
        val H =scanner.nextInt()
        val W =scanner.nextInt()
        if (H == 0 && W == 0) {
            break
        }
        val rectangle = (1..H).map { "#".repeat(W) }.joinToString("\n")
        println(rectangle)
        println()
    }
}

