let rec f x=function|(0,0)->1|(n,_)when n<=0->0|(n,m)->(let a=ref 0in for i=x to 9do if m>=i then a:=!a+f(i+1)(n-1,m-i);done;!a)and q()=Scanf.scanf"%d %d
"(fun n s->if n<>0&&s<>0then q(Printf.printf"%d
"(f 0(n,s))))
;;try q()with _->()