#encoding=utf-8



while True:

	x, num = list(map(int,input().split()))

	if x == num == 0:

		break

	count = 0

	for a in range(10):

		if num == a and x == 1:

			count += 1

		if x > 1:

			for b in range(a + 1,10):

				if num == a+b and x == 2:

					count += 1

				if x > 2:

					for c in range(b + 1,10):

						if num == a+b+c and x == 3:

							count += 1

						if x > 3:

							for d in range(c + 1,10):

								if num == a+b+c+d and x == 4:

									count += 1

								if x > 4:

									for e in range(d + 1,10):

										if num == a+b+c+d+e and x == 5:

											count += 1

										if x > 5:

											for f in range(e + 1,10):

												if num == a+b+c+d+e+f and x == 6:

													count += 1

												if x > 6:

													for g in range(f + 1,10):

														if num == a+b+c+d+e+f+g and x == 7:

															count += 1

														if x > 7:

															for h in range(g + 1,10):

																if num == a+b+c+d+e+f+g+h and x == 8:

																	count += 1

																if x > 8:

																	for i in range(h + 1,10):

																		if num == a+b+c+d+e+f+g+h+i and x == 9:

																			count += 1

																			

	print(count)
import itertools as iter

while True:

	count = 0

	x,y = list(map(int,input().split()))

	if x == y == 0: break

	for element in iter.combinations(list(range(10)),x):

		if sum(element) == y:

			count += 1

	print(count)
# encoding=utf-8
while True:
    x, num = list(map(int, input().split()))
    if x == num == 0:
        break
    count = 0
    for a in range(10):
        if num == a and x == 1:
            count += 1
        if x > 1:
            for b in range(a + 1, 10):
                if num == a + b and x == 2:
                    count += 1
                if x > 2:
                    for c in range(b + 1, 10):
                        if num == a + b + c and x == 3:
                            count += 1
                        if x > 3:
                            for d in range(c + 1, 10):
                                if num == a + b + c + d and x == 4:
                                    count += 1
                                if x > 4:
                                    for e in range(d + 1, 10):
                                        if num == a + b + c + d + e and x == 5:
                                            count += 1
                                        if x > 5:
                                            for f in range(e + 1, 10):
                                                if (
                                                    num == a + b + c + d + e + f
                                                    and x == 6
                                                ):
                                                    count += 1
                                                if x > 6:
                                                    for g in range(f + 1, 10):
                                                        if (
                                                            num
                                                            == a + b + c + d + e + f + g
                                                            and x == 7
                                                        ):
                                                            count += 1
                                                        if x > 7:
                                                            for h in range(g + 1, 10):
                                                                if (
                                                                    num
                                                                    == a
                                                                    + b
                                                                    + c
                                                                    + d
                                                                    + e
                                                                    + f
                                                                    + g
                                                                    + h
                                                                    and x == 8
                                                                ):
                                                                    count += 1
                                                                if x > 8:
                                                                    for i in range(
                                                                        h + 1, 10
                                                                    ):
                                                                        if (
                                                                            num
                                                                            == a
                                                                            + b
                                                                            + c
                                                                            + d
                                                                            + e
                                                                            + f
                                                                            + g
                                                                            + h
                                                                            + i
                                                                            and x == 9
                                                                        ):
                                                                            count += 1
    print(count)

import itertools as iter

while True:
    count = 0
    x, y = list(map(int, input().split()))
    if x == y == 0:
        break
    for element in iter.combinations(list(range(10)), x):
        if sum(element) == y:
            count += 1
    print(count)

-# encoding=utf-8 +import itertools as iter + -    x, num = list(map(int, input().split())) -    if x == num == 0: +    count = 0 +    x, y = list(map(int, input().split())) +    if x == y == 0: -    count = 0 -    for a in range(10): -        if num == a and x == 1: +    for element in iter.combinations(list(range(10)), x): +        if sum(element) == y: -        if x > 1: -            for b in range(a + 1, 10): -                if num == a + b and x == 2: -                    count += 1 -                if x > 2: -                    for c in range(b + 1, 10): -                        if num == a + b + c and x == 3: -                            count += 1 -                        if x > 3: -                            for d in range(c + 1, 10): -                                if num == a + b + c + d and x == 4: -                                    count += 1 -                                if x > 4: -                                    for e in range(d + 1, 10): -                                        if num == a + b + c + d + e and x == 5: -                                            count += 1 -                                        if x > 5: -                                            for f in range(e + 1, 10): -                                                if ( -                                                    num == a + b + c + d + e + f -                                                    and x == 6 -                                                ): -                                                    count += 1 -                                                if x > 6: -                                                    for g in range(f + 1, 10): -                                                        if ( -                                                            num -                                                            == a + b + c + d + e + f + g -                                                            and x == 7 -                                                        ): -                                                            count += 1 -                                                        if x > 7: -                                                            for h in range(g + 1, 10): -                                                                if ( -                                                                    num -                                                                    == a -                                                                    + b -                                                                    + c -                                                                    + d -                                                                    + e -                                                                    + f -                                                                    + g -                                                                    + h -                                                                    and x == 8 -                                                                ): -                                                                    count += 1 -                                                                if x > 8: -                                                                    for i in range( -                                                                        h + 1, 10 -                                                                    ): -                                                                        if ( -                                                                            num -                                                                            == a -                                                                            + b -                                                                            + c -                                                                            + d -                                                                            + e -                                                                            + f -                                                                            + g -                                                                            + h -                                                                            + i -                                                                            and x == 9 -                                                                        ): -                                                                            count += 1