Problem:
Score : 200 points

Problem Statement

You are given a image with a height of H pixels and a width of W pixels.
Each pixel is represented by a lowercase English letter.
The pixel at the i-th row from the top and j-th column from the left is a_{ij}.

Put a box around this image and output the result. The box should consist of # and have a thickness of 1.

Constraints

1 ≤ H, W ≤ 100

a_{ij} is a lowercase English letter.

Input

Input is given from Standard Input in the following format:

H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW}

Output

Print the image surrounded by a box that consists of # and has a thickness of 1.

Sample Input 1

2 3
abc
arc

Sample Output 1

#####
#abc#
#arc#
#####

Sample Input 2

1 1
z

Sample Output 2

###
#z#
###

Solution in Rust (1.15.1) (judge verdict: Accepted)

#![allow(unused)]
use std::io;
use std::collections::*;
use std::str::FromStr;

fn main() {
    let (h, w): (usize, usize) = read_tuple2();

    printw(w);
    for _ in 0..h {
        let line = read_line();
        println!("{}", format!("#{}#", line));
    }
    printw(w);
}

fn printw(w: usize) {
    for _ in 0..w+2 {
        print!("#");
    }
    println!();
}


fn read_line() -> String {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("failed to read line");
    buffer.trim().to_string()
}

fn read_i32() -> i32 {
    read_line().trim().parse().unwrap_or_else(|e| panic!("{}", e))
}

fn read_tuple2<S:FromStr, T:FromStr>() -> (S, T) {
    let v: Vec<String> = read_tokens();
    return (
        v[0].parse().unwrap_or_else(|e| panic!("ohmygod")),
        v[1].parse().unwrap_or_else(|e| panic!("ohmygod"))
    )
}

fn read_tuple3<S:FromStr, T:FromStr, U:FromStr>() -> (S, T, U) {
    let v: Vec<String> = read_tokens();
    return (
        v[0].parse().unwrap_or_else(|e| panic!("ohmygod")),
        v[1].parse().unwrap_or_else(|e| panic!("ohmygod")),
        v[2].parse().unwrap_or_else(|e| panic!("ohmygod"))
    )
}

fn read_tokens<T: std::str::FromStr>() -> Vec<T> {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("failed to read line");
    let mut buffer = buffer.split_whitespace();
    let mut tokens = vec![];
    loop {
        match buffer.next() {
            Some(token) => tokens.push(token.to_string().parse().unwrap_or_else(|e| panic!("ohmygod"))),
            None        => break
        }
    }
    tokens
}