let pair f s = s |>
               Str.split (Str.regexp " ") |>
               List.map f |>
               (function | [a; b] -> (a, b)
                         | _ -> failwith "invalid input")

let board (h, w) =
  let rows =
    let rec make_row i acc = match i with
      | 0 -> String.concat "" acc
      | _ -> make_row (i-1) ((if i mod 2 = 0 then "." else "#") :: acc)
    in
    let row_sub = String.sub (make_row (w+1) []) in
    [|(row_sub 1 w) ^ "\n"; (row_sub 0 w) ^ "\n"|]
  in
  let rec loop i acc = match i with
    | 0 -> acc
    | _ -> loop (i-1) (rows.(i mod 2) :: acc)
  in
  String.concat "" (loop h [])

let rec main_loop () =
  match read_line () with
  | "0 0" -> ()
  | line -> main_loop (print_endline (board (pair int_of_string line)))

let () = main_loop ()