let id x = x
let (h,w) = Scanf.scanf "%d %d" (fun h w -> (h,w))
         
let repeat f n=
    let rec loop acc =function
        | 0->List.rev acc
        | n -> loop (f ():: acc)(n -1) in
    loop [] n

let list' = repeat (fun () -> Scanf.scanf "%s\n" id) (h+1)

let list = List.tl list'         
         
let rec makeshstr w str =
               if w = 0 then str else makeshstr (w-1) ("#" ^ str)  

let shstr = makeshstr w "##"
          
let () =
  let rec pri list =
    match list with
    | [] -> Printf.printf "%s\n" shstr
    | ans :: rest -> (Printf.printf "#%s#\n" ans) ; pri rest
  in Printf.printf "%s\n" shstr; pri list
