#include<stdio.h>
int memo[101][101][1001];
int s,n;
int function(int dps,int con,int sum){
        if(memo[dps][con][sum]!=0)return memo[dps][con][sum];
        if(dps>9){
           if(con==s&&sum==n){
                return 1;
        }
        return 0;
        }
        return memo[dps][con][sum]=function(dps+1,con+1,sum+dps)+function(dps+1,con,sum);
}
int main(void){
    while(1){
    scanf("%d %d",&s,&n);
    printf("%d\n",function(0,0,0));
    if(s==0&&n==0)break;
    }
return 0;
}