#include<iostream>
#include<vector>
using namespace std;
int dfs(int,int);
vector<vector<int>> dp(10,vector<int>(82,-1));
int n,s;
int main(){
	while(1){
		cin>>n>>s;
		if(n==0&&s==0)break;
		dfs(0,0);
	}



	return 0;
}
int dfs(int i,int sum){
	if(i==n-1)return sum;
	for(int j=0;j<=9;++j){
		if(dfs(i+1,sum+j)==s){

		}
	}

}
