#include <bits/stdc++.h>
using namespace std;

int n, s, ans;
void dfs(int now, int num, int total){
    if(num == n){ans+=(total == s); return;}
    for(int i = now; i < 10; i++){
        dfs(i + 1, num + 1, total + i);
    }
    return;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    while(cin >> n >> s){
        if(n == 0 and s == 0) break;
        ans = 0;
        dfs(0, 0, 0);
        cout << ans << endl;
    }

    return 0;
}
