main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
function main(chunk){
    var arr = chunk.split("\n");
    for(var n=0;n<arr.length-1;n++){
        var a = Number(arr[n].split(" ")[0]);
        var b = Number(arr[n].split(" ")[1]);
        for(var i=0;i<a;i++){
            var str = "";
            for(var j=0;j<b;j++){
                str += "#";
            }
            console.log(str);
        }
        console.log("");
    }
}