#include<cstdio>
#include<iostream>
#include<cmath>
#include<ctype.h>
#include<vector>
#include<cstdlib>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<stack>
#include<map>

#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)

using namespace std;
int n,s;
int ans=0;
void solve(int sum,int i,int num) {
	if (sum == s&&i == n) {
		ans++;
		return;
	}
	if (num==9) return;
	solve(sum, i,num+1);
	solve(sum + num, i + 1,num+1);

}

int main()
{
	while (cin >> n >> s) {
		ans = 0;
		if (n == 0 && s == 0)break;
		solve(0, 0, 0);
		cout << ans<<endl;
	}
	return 0;
}