#include<bits/stdc++.h>
using namespace std;
int serch(int i,int j,int n)
{
    if(i==10)return 0;
    else if(!n&&!j)return 1;
    else if(!j||!n||j<i)return 0;
    else return serch(i+1,j-i,n-1)+serch(i+1,j,n);
}
int main()
{
    int n,s;
    while(cin>>n>>s&&(n!=0&&s!=0))cout<<serch(0,s,n)<<endl;
}