#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int dfs(int d, int n, int s) {
  if (n == 0 && s == 0) return 1;
  if (d == 10) return 0;
  return dfs(d + 1, n, s) + dfs(d + 1, n - 1, s - d);
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int n, s;
  while (cin >> n >> s, n) {
    cout << dfs(0, n, s) << endl;
  }

  return 0;
}
