#include <bits/stdc++.h>
using namespace std;
const int max = 51;

int n, s;
int cnt = 0;

void dfs(int i, int sum, int total){
    if(total == n and sum == s){
        cnt++;
        return;
    }
    //足す場合
    if(i < 10 and total != n) dfs(i+1, sum+i, total+1);
    //足さない場足
    if(i < 10 and total != n) dfs(i+1, sum, total);
}

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

    return 0;
}

