#include <iostream>

using namespace std;

int n, s, cnt;
int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

void dfs(int i, int sum, int k) {

    if (k == n && sum == s) { cnt++; }

    if (i == 10 || k == n || sum > s) { return; }

    dfs(i + 1, sum + a[i], k + 1);

    dfs(i + 1, sum, k);
}

int main() {
    while (cin >> n >> s) {
        if (!n && !s) { break; }
        cnt = 0;
        dfs(0, 0, 0);
        cout << cnt << endl;
    }
    return 0;
}