#include <iostream>
using namespace std;

int N, S;

int rec(int sum, int i, int k){
	if(k == N)return sum == S ? 1 : 0;
	if(sum > S)return 0;
	
	int ans = 0;
	for(int j = i; j < 10; j++)
		ans += rec(sum + j, j + 1, k + 1);
	
	return ans;
	
}

int main() {
	while(1){
		cin >> N >> S;
		if(N == 0 && S == 0)break;
		
		cout << rec(0, 0, 0) << endl;
	}
	return 0;
}