#include<iostream>
#include<stdio.h>
using namespace std;
/*
int solve(int n,int m){
  if(2*m>90-(n-1)*n)return 0;
  if(2*m<(n-1)*n)return 0;
  if(n==1)return (0<=m&&m<=9?1:0);
  int res=0;
  if(m-n+1>=0)res+=solve(n-1,m-n+1);
  if(m-n>=0)res+=solve(n,m-n);
  if(m-10>=0)res-=solve(n,m-10);
  return res;
}
*/
int dp[11][101];

int main(){
  int n,m;
  for(int i=0;i<11;i++)
    for(int j=0;j<101;j++)
      dp[i][j]=0;
  for(int i=0;i<=9;i++)dp[1][i]=1;

  for(int i=2;i<=10;i++){
    for(int j=0;j<=100;j++){
      if(j-i>=0)dp[i][j]+=dp[i][j-i];
      if(j-(i-1)>=0)dp[i][j]+=dp[i-1][j-(i-1)];
      if(j-10>=0)dp[i][j]-=dp[i-1][j-10];
 
    }

  }
  /*
  for(int i=0;i<=10;i++){
    for(int j=0;j<=20;j++){
      printf("%2d ",dp[i][j]);
    }
    cout<<endl;
  }
  */
  while(cin>>n>>m&&n&&m){
    cout<<dp[n][m]<<endl;
  }
  return 0;
}