import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

int solve(int n, int s, int c)
{
    if(n<=0) return s?0:1;
    if(s<c || c>9) return 0;
    return iota(c,10).map!(i=>solve(n-1,s-i,i+1)).reduce!"a+b"();
}

void main()
{
    foreach(S;stdin.byLine())
    {
        auto m = S.split().map!(to!int);
        immutable n=m[0], s=m[1];
        if(n==0 && s==0) break;
        writeln(solve(n,s,0));
    }
}