#include <iostream>

using namespace std;

/*	MaxNum以下のnHmNum個の数字でnNumToMakeを作るとき
	何通りの答えがあるかを返す							*/
int dfs(int nhmNum,int nNumToMake,int MaxNum){
	if(nhmNum == 0){
		if(nNumToMake == 0){
			return 1;
		}else{
			return 0;
		}
	}
	if(nNumToMake < 0)
		return 0;
		
	int ans = 0;
	for(int i = 0;i < MaxNum;i++){
		ans += dfs(nhmNum - 1,nNumToMake - i,i);
	}
	return ans;
}

int main() {
	int hmNum,Sum;
	while(1){
		cin >> hmNum;
		cin >> Sum;
		if(hmNum == 0 && Sum == 0)
			break;
		cout << dfs(hmNum,Sum,10) << endl;
	}
	return 0;
}