Y = Array.new
loop{
  H,W=gets.split(' ').map{|v|v=v.to_i}
  Y.push([H,W]) if [H,W]!=[0,0]
  break if [H,W]==[0,0]
}
X = Array.new
0.upto(Y.length-1){|s|
  y=Y[s]
  h=y[0]
  w=y[1]
  1.upto(w){|t|
    X.push("#")
  }
  1.upto(h){|u|
    puts X.join
  }
  puts ""
}