#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int res[11][100];

int pr(int n,int m,int i){
	res[n+1][m+i]++;
	if(i<9){
		pr(n+1,m+i,i+1);
		pr(n,m,i+1);
	}
	return 0;
}

int main() {
	pr(0,0,0);
	int n,s;
	/*for(int i=0;i<10;i++){
		for(int j=0;j<100;j++){
			cout<<res[i][j]<<" ";
		}
		cout<<endl;
	}*/
	for(;n=in(),s=in(),n;){
		if(s<100&&n<11){cout<<res[n][s]<<endl;}
		else {cout<<0<<endl;}
	}
	return 0;
}