#include<iostream>
using namespace std;
int n,s,ans;
int solve(int c,int sum,int m){
  if(c==n && sum==s) ans++;
  for(int i=m;i<10;i++){
    solve(c+1,sum+i,i+1);
  }
}
int main(void){
  for(;;){
    cin >> n >> s;
    if(!n && !s) break;
    ans=0;
    solve(0,0,0);
    cout << ans << endl;
  }
}
