"use strict";
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});
/* 入力は 
3 4
5 6
2 2
0 0
*/
reader.on('close', () => {
    for (var line of lines) {
        var l = line.trim().split(' ').map(Number);
	var h=l[0];
	var w=l[1];

	if (h===0 && w===0) {
	    break;
	}
	//console.log('h: ', h, 'w: ', w )
	console.log(aux(h,w));
    }
});

function aux(h,w)
{
    var l='';
    var s='';
    for (var i=0; i<w; i++) {
	l += '#';
    }
    l += '\n';
    for (var j=0; j<h; j++) {
	s += l;
    }

    //console.log('s: ', s)

    return(s);
}
