#include <bits/stdc++.h>
using namespace std;

int sum( int n, int s, int x ) {
	if( n == 0 ) {
		return s == 0;
	}

	int result = 0;

	for( int i = x; i <= 9; ++i ) {
		result += sum( n-1, s-i, i+1 );
	}

	return result;
}

int main() {
	ios_base::sync_with_stdio( false );

	int n, s;
	while( cin >> n >> s ) {
		if( n == 0 && s == 0 ) { break; }

		cout << sum( n, s, 0 ) << '\n';
	}
}

