let rec f x=function|(0,0)->1|(n,_)when n<=0->0|(n,m)->(let rec(^)i a=if i>m||i>9then a else(i+1)^(a+f(i+1)(n-1,m-i))in x^0)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 _->()