#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<numeric>
#include<stdio.h>

using std::cout;
using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

#define INF 999999999;
#define MOD 1000000007

using ulli = unsigned long long int;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

int N, S;
int saiki(int n, int last, int sum){
    int rt=0;
    if(n == 1){
        if(sum == S) rt = 1;
    }else{
        for(int i = last+1; i < 10; i++){
            rt += saiki(n-1, i, sum+i);
        }
    }
    return rt;
}

int main(){
	cin.tie(0);
	std::ios::sync_with_stdio(false);
    
    while(1){
        cin >> N >> S;
        if(N == 0 && S == 0) break;
        cout << saiki(N+1, -1, 0) << "\n";
    }
}
