#include <stdio.h>

int num(int i, int n, int s){
    int count=0;
    
    if(n==1){
        if(s<i && s>=0) return 1;
        else 0;
    }
    if(i<n) return 0;
    if(s<0) return 0;
    
    for(int j=i-1; j>=0; j--){
        count+=num(j, n-1, s-j);
    }
    
    return count;
}

int main(void){
    int n, s;
    scanf("%d %d", &n, &s);
    
    while(n!=0 && s!=0){
        printf("%d\n", num(10,n,s));
        scanf("%d %d", &n, &s);
    }
    return 0;
}

