var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
arr.some(function(v){
   if(v=="0 0")return true;
   var ns=v.split(" ").map(Number);
   var n=ns[0];
   var s=ns[1];
   var all=[];
   var loop=function(start,ary){
      if(ary.length==n)all.push(ary);
      else{
         for(var i=start;i<=9;i++)loop(i+1,ary.concat(i));
      }
   };
   loop(0,[]);
   var cnt=0;
   all.forEach(function(v){
      var sum=v.reduce(function(a,b){return a+b;});
      if(sum==s)cnt++;
   });
   console.log(cnt);
});