Buggy python submission (verdict: Runtime Error):
from collections import deque


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

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

        try:
            min_num = self.used.index(True)
        except ValueError:
            min_num = 0

        for i in range(min_num, 10):
            if self.used[i] == False and (rem - i) >= 0:
                self.used[i] = True
                self.Q.append(i)
                self.solve(num, rem - 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

        # ????????????
        a = Bt()
        a.solve(n, s)

        # ???????????¨???
        print(len(a.answers))

Fixed submission:
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):
        # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

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

        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)

Buggy python submission (verdict: Runtime Error):
from collections import deque


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

    def solve(self, num, remain):
        num -= 1
        if remain < 10 and self.used[remain] == False and num == 0:
            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

        try:
            min_num = self.used.index(True)
        except ValueError:
            min_num = 0

        for i in range(min_num, 10):
            if self.used[i] == False and (remain - i) >= 0:
                self.used[i] = True
                self.Q.append(i)
                self.solve(num, 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)

Fixed submission:
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):
        # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

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

        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)

Buggy python submission (verdict: Runtime Error):
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)

Fixed submission:
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):
        # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

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

        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)

Buggy python submission (verdict: Runtime Error):
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):
        # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

        if min_choice <= 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()
            # self.answers.append(1)
            return
        elif num < 0:
            return

        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)

Fixed submission:
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):
        # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

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

        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)