#include<bits/stdc++.h>
using namespace std;
int main(){
    int dp[11][46] = {},i,j,k,x,y;dp[0][0] = 1;
    for(i=0;i<10;i++){
        for(j=i+1;j>=1;j--){
            for(k=i;k<=45;k++) dp[j][k] += dp[j-1][k-i];
        }
    }
    while(true){
        scanf("%d%d",&x,&y);
        if(x == 0 && y == 0) break;
        if(y > 45) printf("0\n");
        else printf("%d\n",dp[x][y]);
    }
    return 0;
}
