process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
    const n = chunk.toString();
    const r = n.split("\n");
    r.forEach(x => sp(x));
});

function sp(str){
    const r = str.split(" ").map(x=>Number(x));
    var moji = "";
    for(var i = 0; i < r.length; i++){
        if(r[i] != 0 && r[i+1] != 0){
            for (var d=0; d < r[0]; d++){
                for(var i=0; i < r[1]; i++){
                    moji += "#";
                }
                console.log(moji);
                var moji = "";
            }
            console.log("");
        }else{
            return false;
        }
    }
}
