#include<iostream>

using namespace std;

int count(int n, int s, int a) {
  if (n == 1) {
    if (0 <= s && s <= 9 && a <= s) {
      return 1;
    } else {
      return 0;
    }
  }
    else {
      int c = 0;
      for (int b = a; s - b > 0; b++) {
      c += count(n - 1, s - b, b + 1);
  }
  return c;
}
}
int main() {
  int n, s;
  while (cin >> n >> s, n || s) {
    cout << count(n, s, 0) << endl;
  }
  return 0;
}

