import scala.io.Source

object Main extends App {
  val lines: List[List[Int]] = Source.stdin.getLines.toList.init.map(_.split(" ").toList.map(_.toInt))

  val tupList: List[(Int, String)] = lines.map { line => (line(0), "#"*line(1)) }

  def print = {
    for {
      tup <- tupList
      i <- (0 to tup._1).toList.reverse
    } yield { if (i == 0) println()
             else println(tup._2) }
  }

  print

}