#include <iostream>
#include <cstdint>

std::uint16_t some_of_integer(std::uint16_t n, std::uint16_t s, std::uint16_t sum = 0, std::uint16_t i = 0)
{
	std::uint16_t num_cmb = 0;
	if (n == 0) {
		if (sum + i <= s && s <= sum + 9) {
			++num_cmb;
		}
	}
	else {
		for (; i < 9; ++i) {
			num_cmb += some_of_integer(n - 1, s, sum + i, i + 1);
		}
	}
	return num_cmb;
}

int main()
{
	std::uint16_t n, s;
	for (std::cin >> n >> s; !(n == 0 && s == 0); std::cin >> n >> s) {
		std::cout << some_of_integer(n - 1, s) << std::endl;
	}

	return 0;
}