#include <iostream>
using namespace std;
int n,s;

int dfs(int pos,int selected,int sum){
	if(selected == n)return (sum == s)?1:0;
	if(pos == 10)return 0;
	return dfs(pos+1,selected,sum)+dfs(pos+1,selected+1,sum+pos);
}

int main(){
	while (1) {
		cin>>n>>s;
		if(!(n+s))break;
		cout<<dfs(0,0,0)<<endl;
	}
	return 0;
}