let print_a_rectangle h w =
  let buf = Buffer.create 256 in
  let ws = String.make w '#' in
  let rec loop i =
    if i = h then Buffer.contents buf
    else (Buffer.add_string buf ws; Buffer.add_char buf '\n'; loop (i+1))
  in print_endline (loop 0)

let () =
  let rec loop () =
    let line = read_line () in
    let h,w = Scanf.sscanf line "%d %d" (fun h w -> h,w) in
    if (h,w) = (0,0) then ()
    else loop (print_a_rectangle h w);
  in loop ()