#include <iostream>

using namespace std;

int main() {
    int n, s;
    while (cin >> n >> s) {
        if ((n | s) == 0) break;
        int dp[n + 1][s + 1];
        fill(dp[0], dp[n + 1], 0);
        dp[0][0] = 1;
        for (int i = 0; i <= 9; i++) {
            for (int j = n; j > 0; j--) {
                for (int k = i; k <= s; k++) {
                    dp[j][k] += dp[j - 1][k - i];
                }
            }
        }
        cout << dp[n][s] << endl;
    }
}
