#include <iostream>
using namespace std;

int n, s, dp[11][46];

void set(){
    for(int i = 0; i < 10; i++){
        dp[1][i] = 1;
    }
    for(int i = 1; i < 10; i++){
        for(int j = 0; j < 46; j++){
            dp[i+1][j] = 0;
            if(j >= i) dp[i+1][j] += dp[i][j-i];
            if(j > i) dp[i+1][j] += dp[i+1][j-i-1];
        }
    }
}

int main(){
    set();
    while( true ){
        cin >> n >> s;
        if( n == 0 && s == 0 ) break;
        cout << dp[n][s] << endl;
    }
    return 0;
}