'use strict'

function main(s) {

  s = s.split('\n');

  const w = Number(s[0].split(' ')[1]);

  const top = [...Array(w + 2)].fill('#').join('');
  const mid = s.slice(1, -1).map(n => '#' + n + '#');
  const btm = [...Array(w + 2)].fill('#').join('');

  const ans = [top, ...mid, btm];

  console.log(ans.join('\n'));
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
