#include <iostream>
#include <algorithm>
#include <map>
using namespace std;

inline int ans(int n, int m, int x)
{
	int a = 0;
	if (n == 0 && m == 0) return 1;
	if (n > 0) for (int i = x; i < 10; i++) if (m - i >= 0) a += ans(n - 1, m - i, i + 1);
	return a;
}

int main(void)
{
	int  n, s, num[] = {1,2,3,4,5,6,7,8,9};
	while (cin >> n >> s)
	{
		if (n == 0 && s == 0) break;
		cout << ans(n, s, 0) << endl;
	}
	return 0;
}
