#include <iostream>
#define DEBUG true
using namespace std;

int s;
int cmb;
void count( int n ,int k,int sa ){
  if( DEBUG )
    cout << "n="<<n<<" k="<< k << " sa="<<sa 
	 << " cmb="<<cmb << endl;


  if( n<1 && sa==s ){ ++cmb; return; }
  --n;
  for( int i=k;i<=9;i++ ){
    if( sa+i > s)
      break;
    if( DEBUG )
      cout << " i="<<i<<endl;
    count( n,i+1, sa+i );
  }
}


int main(){
  int n;
  while( cin>>n>>s && (n||s) ){
    if( DEBUG )
      cout << "\nn="<<n<<" s="<<s << endl;
    cmb = 0;
    count( n,0,0 );
    cout << cmb << endl;
  }

  return 0;
}