def inputcase():
	global n,s
	n,s = map(int,input().split())
	return n!=0 or s!=0

memo = [[[0 for j in range(123)] for i in range(11)] for k in range(11)]
done = [[[False for j in range(123)] for i in range(11)] for k in range(11)]

def dfs(k, l, t):
	if t < 0:
		return 0
	elif k == 0 and t > 0:
		return 0
	elif k == 0:
		return 1
	elif l > 9:
		return 0
	if done[k][l][t]:
		return memo[k][l][t]
	done[k][l][t] = True
	for i in range(l,10):
		memo[k][l][t] += dfs(k-1,i+1,t-i)
	return memo[k][l][t]

while inputcase():
	print(dfs(n,0,s))

