const main = (standardInput) => {
    const lengthList = standardInput.split('\n');
    lengthList.pop();

    // console.log(lengthList);

  for(var i=0;i<lengthList.length;i++){
    // console.log(lengthList[i]);
  var items = lengthList[i].split(' ');
  // console.log(items);
  items[0] = Number.parseInt(items[0])
  items[1] = Number.parseInt(items[1])

    // console.log(items);

    for(var j=0;j<items[0];j++){
      for(var k=0;k<items[1];k++){
        process.stdout.write("#")
      }
      console.log("")
    }
    if(i+1!=lengthList.length){
    console.log("")
  }
  }

}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));

