let iota ?(start=0) ?(step=1) cnt =
  let rec doit i acc =
    if i <= 0 then acc
    else doit (i - 1) (start + step*(i - 1) :: acc) in
  doit cnt []

let rec solve (n, s) =
  let rec doit = function
    | (0, 0, _) -> 1
    | (0, _, _) -> 0
    | (n, s, lst) ->
      List.map (fun e ->
        doit (n - 1, s - e, List.filter (fun x -> x > e) lst))
        lst
      |> List.fold_left (+) 0 in
  doit (n, s, iota 10)

let () =
  let rec main_loop () =
    let (n, s) = Scanf.scanf "%d %d " (fun n s -> n, s) in
    if n = 0 && s = 0 then ()
    else begin
      solve (n, s) |> Printf.printf "%d\n";
      main_loop ()
    end in
  main_loop ()