#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)


int n,s;
int ans=0;
int a[100];
//int dp[12][12][10][120] = {0};

int solve(int n,int c,int d,int s){
	if(c==n){
		if(s<=9&&s>=d){
			//cout<<"s="<<s<<endl;
			/*rep(i,n-1){
				cout<<a[i+1]<<" ";
			}
			cout<<s<<endl;*/
			ans++;
		}
	}
	else{
		//cout <<"d = "<< d <<endl;
		for(int i=d;i<10;i++){
			//cout<<"i = "<<i<<endl;
			a[c] = i;
			solve(n,c+1,i+1,s-i);
		}
	}
	return ans;
}
	
	

int main(){
	while(cin>>n>>s,!(n==0&&s==0)){
		ans = 0;
		rep(i,100) a[i] = 0;
		//cout<<n<<" "<<s<<endl;
		//solve(n,n,s);
		//dp[n][1][1][s] = solve(n,n,1,s);
		cout << solve(n,1,0,s) <<endl;
	}
	return 0;
}