#include <iostream>
using namespace std;
int cnt;
int n,sum;
void dfs(int n, int i , int s){

  if(s == sum && n == 0){
    cnt++;
    return; 
  }

  if(i > 10 || n == 0 ){
    return; 
  }
  dfs(n,i + 1,s);
  dfs(n-1,i + 1,s + i);
}

int main(){

  while( cin >> n >> sum, n + sum){
    cnt = 0;
    dfs(n,0,0);
    cout << cnt << endl;
  }

  return 0;
}