var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var a = input.split('\n');
for (var i=0;i<a.length;i++){
    var b = a[i].split(' ').map(Number);
    var h = b[0];
    var w = b[1];
    if(h === 0 && w === 0){
        break;
    }
    console.log(Array(h + 1).join(Array(w + 1).join('#') + '\n'));
}
