'use strict';
(function(stdin) {
  var lines  = stdin.toString().split('\n');
  var result = (function(data) {
    return data.filter(function(line){
      return line.split(' ').map(Number).every(function(v){return v !== 0;});
    })
    .map(rectAngle).join('\n');

    function rectAngle(v) {
      v = v.split(' ').map(Number);
      var h = v[0];
      var w = v[1];
      var rectangle = [];
      for (var i = 0; i < h; i++) {
        rectangle.push(line(w));
      }
      function line(w) {
        var line = '';
        for (var i = 0; i < w; i++)
          line += '#';
        return line;
      }
      rectangle.push('');
      return rectangle.join('\n');
    }

  }(lines
  ));

  if(result.length !== 0) console.log(result);

}(require('fs').readFileSync('/dev/stdin', 'utf8')));