#include<iostream>
using namespace std;
int syu(int *p,int n){
  int s=0;
  for(int i=0;i<n;i++) s += p[i];
  return s;
}
int main(){
  int n,s;
  while(cin>>n>>s){
    if(n==0&&s==0) break;
    int p[n],count=0;
    for(int a=0;a<=9;a++){
      p[0] = a;
      if(n==1&&syu(p,n)==s){
	count++;
	continue;
      }
      for(int b=a+1;b<=9;b++){
	p[1] = b;
	if(n==2&&syu(p,n)==s){
	  count++;
	  continue;
	}
	for(int c=b+1;c<=9;c++){
	  p[2] = c;
	  if(n==3&&syu(p,n)==s){
	    count++;
	    continue;
	    for(int d=c+1;d<=9;d++){
	      p[3] = d;
	      if(n==4&&syu(p,n)==s){
		count++;
		continue;
		for(int e=d+1;e<=9;e++){
		  p[4] = e;
		  if(n==5&&syu(p,n)==s){
		    count++;
		    continue;
		    for(int f=e+1;f<=9;f++){
		      p[5] = f;
		      if(n==6&&syu(p,n)==s){
			count++;
			continue;
			for(int g=f+1;g<=9;g++){
			  p[6] = g;
			  if(n==7&&syu(p,n)==s){
			    count++;
			    continue;
			  }
			  for(int h=g+1;h<=9;h++){
			    p[7] = h;
			    if(n==8&&syu(p,n)==s){
			      count++;
			      continue;
			    }      
			    for(int i=h+1;i<=9;i++){
			      p[8] = i;
			      if(n==2&&syu(p,n)==s){
				count++;
				continue;
			      }
			    }
			  }
			}
		      }
		    }
		  }
		}
	      }
	    }
	  }
	}
      }
    }
    cout << count << endl;
  }
  return 0;
}