#include <iostream>
using namespace std;

int s;
int cmb;
void count( int n ,int k,int sa ){
  if( n<1 && sa==s ) ++cmb;
  --n;
  for( int i=k;i<=9;i++ )
    count( n,i+1, sa+i );
}


int main(){
  int n;
  while( cin>>n>>s && (n||s) ){
    cmb = 0;
    for( int i=0;i<=9;i++ )
      count( n,i,i );
    cout << cmb << endl;
  }

  return 0;
}