

#include <iostream>
#include <vector>
#include <string>
#include <numeric>

int func( const std::vector<int>& v, int n, int s ){
    int sum = 0;
    if ( n == v.size() ){
        if ( std::accumulate(v.begin(),v.end(),0) == s ){ return 1; }
        return 0;
    } else {
        for( int i=*(v.end()-1)+1; i<10; ++i ){
            std::vector<int> vx{v};
            vx.push_back(i);
            sum += func(vx, n, s);
        }
    }
    return sum;
}

int main(){
    for(;;){
        int n,s; int sum = 0;
        std::cin >> n >> s;
        if ( (n==0) && (s==0) ){return 0;}
        for( int i=0; i<10; ++i ){
            std::vector<int> v = {i};
             sum += func( v, n, s );
        }
        std::cout << sum << std::endl;
    }
}
