#include <iostream>
using namespace std;
// b~9ツづ慊づづ個青板篠堋づーnツ古つ使ツづづгツづーツ催ャツづゥツ津環づィツ青板づーツ陛板つキ
int solve(int n,int s,int b)
{
  if(s < 0 || b > 9) return 0;
  if(n == 0) return s==0 ? 1 : 0;
  int ret=0;
  for(int i=b;i<10;i++){
    ret += solve(n-1,s-i,i+1);
  }
  return ret;
}
int main(void)
{
  int n,s;
  for(;;){
    cin >> n >> s; if(n+s == 0) break;
    cout << solve(n,s,0) << endl;
  }
}