#include <iostream>
using namespace std;
int solve(int n,int s,int l)
{
  if(s < 0 || l > 9) return 0;
if(n == 0) {
    if(s == 0) return 1;
    return 0;
 }
 int ret=0;
 for(int i=l;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;
  }
}