#include<iostream>
using namespace std;

int n,s,cnt=0;

void dfs(int num,int sum,int i){
	if(sum == s and num != n-1){
		cnt++;
		return;
	}
	if(num == 0) return;
	if(i == -1) return ;
	if(sum >= s) return ;
	i--;
	dfs(num,sum,i);
	dfs(num-1,sum+i,i);
	return ;
}


int main(){

	cin >> n >> s;

	while(n+s!=0){
		cnt = 0;
		dfs(n,0,10);
		cout << cnt << endl;
		cin >> n >> s;
	}
	return 0;
}