process.stdin.setEncoding('utf-8');
process.stdin.on('data', (input) => {
  var arry = input.split('\n');
  for (var i = 0; i < arry.length; i++) {
    var items = arry[i].split(' ').map(Number);
    var h = items[0];
    var w = items[1];

    if (!h && !w) break;

    console.log(Array(h + 1).join(Array(w + 1).join('#') + '\n'));
  }
