#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int func(int n,int s,int mimnum){
    int  cnt=0;
    if(n==1 and s >= mimnum and s <= 9) return 1;
    for(int i=mimnum;i<min(11-n,s);i++){
        cnt += func(n-1,s-i,i+1);
    }
    return cnt;
}
int main(int argc, void *argv[]){
    int n,s;
    while(true){
        cin>>n>>s;
        if(n==0 and s==0) break;
        cout<<func(n,s,0)<<endl;;
    }
}