#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1e9 + 7;
const long long INF = 1LL << 60;

bool notuse[10];
int cnt;

void dfs(int n,int k)
{
    if(n==0 && k == 0){
        cnt++;
        return ;
    }else{
        for(int i = 0; i < 10; i++){
            if(notuse[i] && k - i >= 0){
                notuse[i] = false;
                dfs(n-1,k-i);
                notuse[i] = true;
            }
        }
    }
}

int main() 
{
    ll div[9] = {1};
    for(int i = 1; i < 9; i++){
        div[i]=div[i-1]*(i+1);
    }
    while(true){
        int n,s; cin >> n >> s;
        if(n==0 && s == 0) break;
        for(int i = 0; i < 10; i++){
            notuse[i] = true;
        }
        cnt = 0;
        dfs(n,s);
        cout << cnt/div[n-1] << endl;
    }
}
