#include <cstdio>
using namespace std;

int pattern_num[1];

void find_pattern(int now, int sum, int t_n, int n, int s) {
	//printf("%d %d %d %d %d\n",now ,sum, t_n, n, s);
	// Found
	if (t_n == n && sum == s) {
		pattern_num[0]++;
		return;
	}
	// Search
	for (int i = now+1; i < 10; i++) {
		if (sum+i <= s)
			find_pattern(i, sum+i, t_n+1, n, s);
	}
	return;
}

int main(int argc, char *argv[]) {
	int n, s;
	while (true) {
		// init
		pattern_num[0] = 0;
		// load data
		fscanf(stdin, "%d %d", &n, &s);
		// End of Program
		if (n == 0 && s == 0) {
			break;
		}
		// find pattern
		for (int i = 0; i < 10; i++) {
			if (i <= s)
				find_pattern(i, 0, 1, n, s);
		}
		// print
		printf("%d\n", pattern_num[0]);
	}
	return 0;
}