#include <bits/stdc++.h>
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;

int dfs(int i, int sum, int total){
	if(i <= 10 && sum == 0 && total == 0) return 1;
	if(i >= 10 || sum < 0 || total < 0) return 0;

	return dfs(i+1, sum-i, total-1) + dfs(i+1, sum, total);
}

int main(){
	int n, s, count;
	while(1){
		cin >> n >> s;
		if(n == 0 && s == 0) break;
		count = 0;
		count = dfs(0, s, n);
		cout << count << endl;
	}
}
	

