let print_chess h w = (for i = 1 to h do
                         for j = 1 to w do
                           if i mod 2 = 1 then
                             begin
                               print_char (if j mod 2 = 1 then '#' else '.')
                             end
                           else
                             begin
                               print_char (if j mod 2 = 1 then '.' else '#')
                             end 
                         done;
                         print_newline()
                       done) ;;

let rec f() = Scanf.scanf "%d %d\n" (fun h w -> if h > 0 && w > 0 then
                                                  begin
                                                    print_chess h w;
                                                    print_newline();
                                                    f()
                                                  end) ;;
f() ;;
