let (inp,out) = (open_in "class.in", open_out "class.out");;
let (n,r,c) = Scanf.fscanf inp "%d %d %d" (fun a b c -> (a,b,c));;

let fullness = min (min r c) ((n+1)/2);; (* class limit & students limit *)

let rec print i extra = 
  if i <= r then (
    let required_here = match i with
        1 -> fullness
      | i when i <= fullness -> 1
      | _ -> 0 in
    let extra_here = min (c - required_here) extra in
    let students_here = extra_here + required_here in
    Printf.fprintf out "%s" (String.make students_here '#');
    Printf.fprintf out "%s\n" (String.make (c - students_here) '.');
    print (i+1) (extra - extra_here)
  );;

Printf.fprintf out "%d\n" fullness;;
print 1 (n - (fullness*2-1));;

close_in inp; close_out out;;
