//0030
//template
//include-------------------------------------
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<stack>

using namespace std;

//typedef--------------------------------------
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

#define MP make_pair

//repetition-----------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

//constant-------------------------------------
const double PI = acos(-1.0);

//cout,cin-------------------------------------
#define COUT(x) cout<<(x)<<endl;
#define CIN(x) cin>>(x);

int dfs(int n, int s, int p, int ans){
	if (p>10) return 0;
	if (n == 0) return s == 0 ? 1 : 0;
	for (int i = p; i < 10; i++)
		ans += dfs(n--, s - i, p++, ans);
	return ans;
}

int main(){

	int n, s;
	while (cin >> n >> s){
		if (n == 0 && s == 0) break;
		COUT(dfs(n, s, 0, 0))
	}

	return 0;

}