fun main(args: Array<String>) {
    val (h, w) = readLine()!!.split(" ").map(String::toInt)
    val lines = Array<String>(h) {readLine()!!}
    val result = lines.joinToString(separator = "\n",
            prefix = "#".repeat(w + 2) + "\n",
            postfix = "\n" + "#".repeat(w + 2)) { line -> "#" + line + "#" }

    println(result)
}