#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 solve(int c,int d,int s){
	if(c==n){
		if(s<=9&&s>=d){
			ans++;
		}
	}
	else{
		for(int i=d;i<10;i++){
			solve(c+1,i+1,s-i);
		}
	}
	return ans;
}
	
	

int main(){
	while(cin>>n>>s,n||s){
		//if(s>45) cout<<"0"<<endl;
		ans = 0;
		cout << solve(1,0,s) <<endl;
	}
	return 0;
}