import std.string;
import std.stdio;
import std.conv;
import std.algorithm;

int[] nums = [0,1,2,3,4,5,6,7,8,9];
int n,s;

int saiki(int x,int m,int item){

    if(m == s && item == n) return 1;
    if(x == 10) return 0;
    return saiki(x+1,m+nums[x],item+1) + saiki(x+1,m,item);
}


void main(){

    while(true){
	auto ss = split(readln());
	n = to!int(ss[0]);
	s = to!int(ss[1]);
	if(n == 0 && s == 0) break;
	writeln(saiki(0,0,0));
    }
}