#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <stack>
#include <queue>
#include <time.h>

using namespace std;
typedef long long ll;
#define pl pair<ll,ll>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second

int n, s;//n 1~9 s 0~100
int ans=0;
//?????????????????¶.i??????????????????j??¨??????
//??\????????????????????????????????§????????????????????\???????????????.
int solve(int i,int j, int k){
	if(i==n){
		if(k==s)ans++;
	}else{
		FOR(l,j+1,10){
			if(k+l<=s){
				solve(i+1,l,k+l);
			}	
		}
	}
	return ans;
}


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