#include <cstdio>

int n, s, res;

void dfs(int prev, int deep, int sum);

int main(void)
{
	while (scanf("%d %d", &n, &s)){
		if (n == s && s == 0) break;
		
		res = 0;
		for (int i = 0; i < 10; i++){
			dfs(i, 1, i);
		}
		
		printf("%d\n", res);
	}
	
	return (0);
}

void dfs(int prev, int deep, int sum)
{
	if (deep == n && sum == s){
		res++;
		return;
	}
	if (n < deep) return;
	if (s < sum) return;
	
	for (int i = prev + 1; i < 10; i++){
		dfs(i, deep + 1, sum + i);
	}
	
	return;
}