let inputs = require('fs').readFileSync('/dev/stdin', 'UTF-8').split('\n');
for( let i=0; i<inputs.length; i++ ) {
  const h = inputs[i].split(' ').map(Number)[0];
  const w = inputs[i].split(' ').map(Number)[1];
  let rect = '';
  let width = '';
  let height = '';
  if ( h === 0 && w === 0 ) {
    break;
  } else {
    for (let i=1; i<=w; i++) {
      width += '#';
    }

    if (h <= 1) {
      rect = width + '\n';
    } else {
      for (let i=1; i<=h; i++) {
        rect += width + '\n';
      }
    }
    console.log(rect);
  }
}

