#include<iostream>
using namespace  std;
int dfs(int p,int n, int s)
{
	if (s == 0 && n == 0)return 1;
	int ret = 0;
	for (int i = p + 1; i <= 9; i++)
	{
		ret += dfs(i, n - 1, s - i);
	}
	return ret;
}
int main()
{
	int n, s;
	while (cin >> n >> s)
	{
		if (n == 0 && s == 0)break;
		cout << dfs(-1, n, s) << endl;
	}
	return 0;
}