var chunk = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = chunk.split('\n');

while (true) {
    var hw = lines.shift().split(' ').map(Number);
    var h = hw[0], w = hw[1];
    if (0 === h && 0 === w) {
        break;
    }
    var side = '';
    for (var i = 0; i < w; i++) {
        side += '#';
    }
    side += '\n';
    var rectangle = '';
    for (var i = 0; i < h; i++) {
        rectangle += side;
    }
    console.log(rectangle);
}