//!
///

/**============= Approach =================**
@Author: A Asif Khan Chowdhury
@Category:
/**========================================**/


/**................ Headers ................**/
#include <iostream>
#include <vector>
#include <map>
#include <cstring>
#include <list>
#include <queue>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <sstream>
#include <bitset>
#include <set>

using namespace std;

/**................ Macros ................**/
#define Set(N, j) (N|(1<<j))
#define reset(N, j) (N&~(1<<j))
#define Check(N, j) (bool)(N&(1<<j))
#define toggle (N, j) (N^(1<<j))
#define turnOff(N, j) (N & ~(1<<j))
#define CLEAR(A, x) ( memset(A,x,sizeof(A)) )
#define pi 3.141592653589793
#define pii pair <int, int>
#define pb push_back
#define pf printf
#define S(x) scanf("%d", &x)
#define SL(x) scanf("%ld", &x)
#define out(C) printf("Case %d: ", C);
#define FOR(i, x, y) for(int i=x; i<=y; i++)
#define open freopen("E:/a.txt", "r", stdin);
#define write freopen("E:/b.txt","w", stdout);
#define MAX (1+(1<<5))
#define inf 0x7fffffff
#define ll long long
#define mod 100000007
#define mx 100010

///**==========Global Variables ===========**///

///**======================================**///

int gcd(int a, int b) { return b?gcd(b,a%b):a; }
//bool taken[12];
int bt (int make, int left, int till){
    if(make==0 and left==0) return 1;
    if(make<=0 or left<=0) return 0;
    int ans=0;
    for(int i=till; i<10 ; i++){
        //if(!taken[i])
        {
            //taken[i]=true;
            ans+=bt(make-i, left-1, i+1);
           // taken[i]=0;
        }
    }

//    cout<<make<<" "<<left<<" "<<ans<<endl;
    return ans;
}


int main()
{
	cin.tie(NULL);
//	open
    int test;
    int a, b;
    while(cin>>a>>b){
            if(a==0 and b==0)break;
       // CLEAR(taken,0);
        cout<<bt(b, a, 0)<<endl;

    }
    return 0;
}