function pint(s)   { return parseInt(s);   }
function pfloat(s) { return parseFloat(s); }                                                                                                                                                                                                                                                                                  function even(s)   { return (s % 2) === 0; }                                                                                                                                                                                                                                                                                  function odd(s)    { return (s % 2) === 1; }                                                                                                                                                                                                                                                                                  Array.prototype.sortNumAsc  = function ()  { return this.sort((a, b) => (a - b)); };                                                                                                                                                                                                                                          Array.prototype.sortNumDesc = function ()  { return this.sort((a, b) => (b - a)); };                                                                                                                                                                                                                                          Array.prototype.sortStrAsc  = function ()  { return this.sort();                  };                                                                                                                                                                                                                                          Array.prototype.sortStrDesc = function ()  { return this.sort().reverse();        };                                                                                                                                                                                                                                          Array.prototype.without     = function (x) { return this.filter(e => e !== x);    };
function main(lines) {
  var a = lines[0].split(' ').map(pint);
  var H = a[0];
  var W = a[1];
  for (var h = 0; h < (H + 2); h++) {
    if (h === 0 || h === (H + 1)) {
      console.log(Array(W+3).join("#"));                                                                                                                                                                                                                                                                                          } else {
      console.log("#" + lines[h] + "#");
    }
  }
}                                                                                                                                                                                                                                                                                                                             main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n').map(l => l.trim()));

Measured memory_bytes: 21192