#include <iostream>
#include <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

void dfs(int i, int n, int sum, int s, int pre_number, int &count){
	if(i == n){
		if(sum == s){
			count++;
		}
		return;
	}
	
	for(int j = pre_number + 1; j < 10; j++){
		if(sum + j <= s){
			dfs(i + 1, n, sum + j, s, j, count);
		}
	}
	return;
}

int main(int argc, char **argv){
	int n, s;
	int count = 0;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif


#if INPUT_FROM_FILE
	while(ifs >> n >> s){
#else
	while(std::cin >> n >> s){
#endif
		if(n == 0 && s == 0){
			break;
		}
	
		count = 0;
		dfs(0, n, 0, s, -1, count);

		std::cout << count << std::endl;
	}


	return 0;
}
