let rec print_rectangle h w =
  match h with
  |0 -> ()
  |_ -> let rec print_sharp w =
          match w with
          |0 -> print_string "\n"
          |_ -> print_string "#";
                print_sharp (w-1)
        in
        print_sharp w;
        print_rectangle (h-1) w
;;

let () =
  let rec loop () =
    Scanf.sscanf (read_line()) "%d %d" (fun h w -> if h != 0 || w != 0 then
                                                     begin
                                                       print_rectangle h w ;
                                                       print_string "\n";
                                                       loop ()
                                                     end
      )
    in
    loop ()
;;
