#include <iostream>

//n : n????????°???????¶?????????§
//s : ?????????s?????????
int n, s;
int ans;

void dfs(int a, int sum, int bmax) {
	if(a < n) {
		if(sum == s)
			++ans;
		else {
			for(int i = bmax + 1; i <= 9; ++i) {;
				if(sum + i <= s)
					dfs(a + 1, sum + i, i);
			}
		}
	}
}

int main() {
	while(std::cin >> n >> s, !(n == 0 && s == 0)) {
		if(n <= s)
			dfs(0, 0, 0);
		
		std::cout << ans << std::endl;
		
		ans = 0;
	}
}