const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/);
for (let i = 0; i < input.length; i++) {
    let [a, b] = input[i].split(' ').map(Number);
     if (a === 0 && b === 0) {
        break;
         }
    for (let j = 0; j < a; j++) {
        console.log('#'.repeat(b));
    }
    console.log('');
}

