object Main {
    import scala.annotation.tailrec

    def main(args: Array[String]) = {
        val sc = new java.util.Scanner(System.in)

        drawRectangle(sc)
    }

    @tailrec
    def drawRectangle(scanner: java.util.Scanner): Unit = {
        val h, w = scanner.nextInt

        if( h != 0 || w != 0 ) {
            for( i <- 0 until h ) println("#"*w)
            print("\n")
            drawRectangle(scanner)
        }
    }

}

