const arr = require('fs').readFileSync('/dev/stdin','utf8').match(/^[\s\S]*?(?=\n0 0)/g)[0].split('\n').map(r=>r.split(' ').map(Number));
console.log(arr.map(([H,W])=>[...Array(H).keys()].map(()=>'#'.repeat(W)).join('\n')).join('\n\n'))
