#include<iostream>
using namespace std;
int ans = 0;
void solve(int n, int s, int i) {
	if (n == 0 && s == 0) {
		ans++;
		return;
	}
	else if (n == 0 || i == 10) return;
	solve(n, s, i + 1);
	solve(n - 1, s - i, i + 1);
}
int main() {
	int n, s;
	while (cin >> n >> s&&n + s) {
		ans = 0;
		solve(n, s, 0);
		cout << ans << endl;
	}
}
