#include <algorithm>
#include <iostream>
using namespace std;

int Dfs(int n, int s, int p) {
  if (n == 0 && s == 0)
    return 1;
  if (n < 0)
    return 0;
  int res = 0;
  for (int i = p + 1; i <= 9; ++i)
    res += Dfs(n - 1, s - i, i);
  return res;
}

int main() {
  while (true) {
    int n, s;
    cin >> n >> s;
    if (n == 0 && s == 0)
      break;
    cout << Dfs(n, s, -1) << endl;
  }
}
