import std.stdio;
import std.range;
import std.conv;
import std.string;
import std.algorithm;

void main() {
    int[][] answer_table = new int[][](10, 101);

    for (int i = 0; i < 1 << 10 - 1; i++) {
        int digit = i;
        int sum = 0;
        int count = 0;
        for (int j = 0; j < 10; j++) {
            if ((digit & 1) == 1) {
                sum += j;
                count++;
            }
            digit = digit >> 1;
        }
        answer_table[count][sum]++;
    }

    foreach (string line; stdin.lines) {
        if (line == "0 0\n") {
            break;
        }

        auto ns = line.chomp.split.map!(to!int);
        int n = ns[0];
        int s = ns[1];

        writeln(answer_table[n][s]);
    }
}