#include <stdio.h>

int n,s;

int ans;

//depth first search
void dfs(int i,int sum,int n) {

  //³ð
  if((sum==s) && (n==0)) {

    ans++;
    return;

  }

  //s³ð
  if((i==10) || (n==0)) return;

  //Tõr
  dfs(i+1,sum,n); //iðgíÈ¢p^[(±êð»êÈãÅ«È­ÈéÜÅ±¯é)
  dfs(i+1,sum+i,n-1); //iðg¤p^[

}

int main(void) {

  while(scanf("%d %d",&n,&s)!=EOF) {

    if((n==0) && (s==0)) break;

    ans=0;

    dfs(0,0,n);

    printf("%d\n",ans);

  }

  return 0;

}
      