#include <iostream>
using namespace std;
int n,s,ans=0;

void search(int num,int sum,int pos) {
  if(num == 0) {
    if(sum == s) {
      ans++;
      return;
    }
  }
  for(int i=pos;i<10;i++) {
    search(num-1,sum+i,i+1);
  }
}

int main() {
  while(cin >> n >> s) {
    if(n==0&&s==0)break;
    search(n,0,0);
    cout << ans << endl;
    ans = 0;
  }
}