#include<iostream>
using namespace std;
int ans;

void solve(int n, int s, int sum, int x){
	//cout << "t " << n << ' ' << s << ' ' << sum << ' ' << x << endl;
	if(n == 0){
		if(sum == s) ans++;
		return;
	}
	if(sum > s) return;

	for(int i = 0; i < x; i++){
		solve(n - 1, s, sum+i, i);
	}
}

int main(void){
	int n, s;
	while(1){
		cin >> n >> s;
		if(n == 0 && s == 0) break;
		ans = 0;
		solve(n, s, 0, 10);

		cout << ans << endl;
	}
}