x = gets()
y = x.split()
h = y[0].to_i
w = y[1].to_i

until h == 0 && w == 0
 i = 1
 while i <= h
  k = "#" * w
  puts  k
  i += 1
 end
 puts ""
 x = gets()
 y = x.split()
 h = y[0].to_i
 w = y[1].to_i
end
