Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

func solve(a, b, c int) int {
	if a == 1 && b >= c && b < 10 {
		return 1
	}
	if a == 1 {
		return 0
	}
	ret := 0
	for i := c; i < 10 && i < b; i++ {
		ret += solve(a-1, b-i, i+1)
	}
	return ret
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for {
		scanner.Scan()
		a, _ := strconv.Atoi(scanner.Text())
		if a == 0 {
			break
		}
		scanner.Scan()
		b, _ := strconv.Atoi(scanner.Text())
		fmt.Println(solve(a, b, 0))
	}
}

Python: from collections import deque


class Bt(object):
    def __init__(self):
        self.used = [False] * 10  # 0-9????????°???????????¨?????????????????????????????°
        self.answers = []  # ?????¶???????????????????????????
        self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨

    def solve(self, num, remain):
        if remain < 10 and self.used[remain] == False and num == 1:
            self.Q.append(remain)
            # print('{0}'.format(self.Q))
            ans = [*self.Q]
            ans.sort()
            if not ans in self.answers:
                self.answers.append(ans)
            self.Q.pop()
            return
        elif num < 0:
            return

        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

        for i in range(min_choice, 10):
            if self.used[i] == False and (remain - i) >= 0:
                self.used[i] = True
                self.Q.append(i)
                self.solve(num - 1, remain - i)
                self.used[i] = False
                self.Q.pop()


if __name__ == '__main__':
    while True:
        # ??????????????\???
        n, s = [int(x) for x in input().split(' ')]
        if n == 0 and s == 0:
            break

        if 0 <= s <= 45:
            # ????????????
            a = Bt()
            a.solve(n, s)

            # ???????????¨???
            print(len(a.answers))
        else:
            print(0)

Python: while(True):
    n, s = map(int, input().split())
    if n == 0: break

    def dfs(a, b, used):
        if a == n: return s == b

        ret = 0
        for i in range(used+1, 10):
            ret += dfs(a + 1, b + i, i)
        return ret

    print(dfs(0, 0, -1))

Python: import itertools
while 1:
 n,s=map(int,input().split())
 if n==0:break
 print(sum(1 for p in itertools.combinations(range(10),n)if sum(p)==s))

Python: # 0030
import itertools
while True:
    n, s = map(int, input().split())
    if n == s == 0: break
    c = itertools.combinations(range(10), n)
    print(len(list(filter(lambda c: sum(c) == s, c))))

Python: def func(i,ls):
    if i == 10:
        return len(ls) == n and sum(ls) == s
    return func(i + 1,ls) + func(i + 1,ls + [i])
 
while True:
    n,s = map(int,input().split())
    if n == 0:
        break
    print(func(0,[]))

Python: import sys
f = sys.stdin

while True:
    n, s = map(int, f.readline().split())
    if n == 0:
        break
    print(sum(1 for nums in itertools.combinations([i for i in range(10)], n) if sum(nums) == s))

Python: # p: max in adder ; n: number of adders;  s: sum
def dfs(p, n, s):
    if not p:
        if n == 1 and s == 0:
            return 1
        else:return 0
    elif n == 1:
        if 0 <= s <= p:
            return 1
        else: return 0
    elif s < 0:
        return 0
    else:
        return dfs(p-1, n-1, s-p) + dfs(p-1, n, s)

while True:
    try:
        n, s = list(map(int, input().split()))
        if (not n and not s):
            break
        print(dfs(9, n, s))
    except:
        break

Python: from itertools import combinations
while True:
    n,s = [int(i) for i in input().split()]
    if (n, s) == (0, 0):
        break
    ans = 0
    for num in combinations(range(10),n):
        if sum(num) == s:
            ans += 1
    
    print(ans)

Python: from itertools import combinations
while True:
    cnt = 0
    n,s = map(int,input().split())
    if n==0 and s==0:
        break
    for i in combinations(range(10),n):
        if sum(i)==s:
            cnt=cnt+1
    print(cnt)

Python: import itertools
while 1:
    n,s=map(int, input().split())
    if n==0: break
    print(len([1 for c in itertools.combinations(range(10), n) if sum(c)==s]))

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools

S = []
N = []
while True:
    n,s = map(int,input().split(" "))
    if s == 0 and n == 0:
        break
    else:
        N.append(n)
        S.append(s)

for i in range(0,len(S)):
    sumMap = list(map(sum,list(itertools.combinations(range(0,10),N[i]))))
    print(sum([1 for j in range(0,len(sumMap)) if sumMap[j] == S[i]]))

Python: from itertools import combinations
while 1:
 n,s=map(int,input().split())
 if n==0:break
 print(sum(1 for p in combinations(range(10),n)if sum(p)==s))

Python: # -*- coding: utf-8 -*-

import sys
import os
import datetime
from itertools import combinations

for s in sys.stdin:
    n, s = map(int, s.split())
    if n == 0:
        break

    cnt = 0
    for x in combinations(range(10), n):
        if sum(x) == s:
            cnt += 1
    print(cnt)

Python: import sys
import itertools

for line in sys.stdin:
    (n, s) = map(int, line.split(" "))
    if n == 0 and s == 0:
        break
    cnt = 0
    for v in itertools.combinations(range(10), n):
        cnt += sum(v) is s
    print(cnt)

Python: import itertools

while True:
    n,s=[int(i) for i in input().split(" ")]
    if n==0 and s==0:
        break
    retval=0
    for i in itertools.combinations([j for j in range(10)],n):
        if sum(i)==s:
            retval+=1
    print(retval)

Python: # Aizu Problem 0030: Sum of Integers
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

def dfs(pos, t, sum):
    global cnt
    if t == n:
        if sum == s:
            cnt += 1
        return
    if pos > 9:
        return
 
    dfs(pos+1, t, sum)
    dfs(pos+1, t+1, sum + pos)
 
 
while True:
    n, s = [int(_) for _ in input().split()]
    if n == s == 0:
        break
    cnt = 0
    dfs(0, 0, 0)
    print(cnt)

Python: import itertools
for e in iter(input,'0 0'):
 n,s=map(int,e.split())
 print(sum(s==sum(p)for p in itertools.combinations(range(10),n)))

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools

S = []
N = []
while True:
    n,s = map(int,input().split(" "))
    if s == 0 and n == 0:
        break
    else:
        N.append(n)
        S.append(s)

for i in range(0,len(S)):
    sumMap = list(map(sum,list(itertools.combinations(range(0,S[i]+1),N[i]))))
    print(sum([1 for j in range(0,len(sumMap)) if sumMap[j] == S[i]]))

Python: def dfs(n, s, min):
  if min > s:
    return 0
  if min == 10:
    return 0
  if n == 1:
    if min <= s and s < 10:
      return 1
    else:
      return 0
  else:
    sum = 0
    for i in range(min, 10):
      sum += dfs(n - 1, s - i, i + 1)
    return sum
  
while True:
  n, s = map(int, input().split())
  if n + s == 0:
    break
  print(dfs(n, s, 0))

Python: import sys
from itertools import combinations as c
for line in sys.stdin:
    count = 0
    k, v = map(int, line.split())
    if k or v:
        for i in c(range(10), k):
            if sum(i) == v:
                count += 1
    else:
        break
    print(count)

Python: import sys
f = sys.stdin

import itertools

while True:
    n, s = map(int, f.readline().split())
    if n == 0:
        break
    print(sum(1 for nums in itertools.combinations([i for i in range(10)], n) if sum(nums) == s))

Python: def counter(rest, n, acc, to):
  if rest == 0:return acc == to
  if n == 10:return 0 
  return counter(rest - 1, n + 1, acc + n , to) + counter(rest, n + 1, acc, to)
 
while True:
  n, s = map(int, input().split())
  if not n:
    break
  print(counter(n, 0, 0, s))