Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

class Node:
    def __init__(self, idx):
        self.idx = idx
        self.a = []


n, x, y = map(int, input().split())
nodes = []

for i in range(n):
    node = Node(i+1)
    nodes.append(node)

for i in range(n-1):
    cur = nodes[i]
    next = nodes[i+1]

    cur.a.append(next)
    next.a.append(cur)

X = nodes[x-1]
Y = nodes[y-1]
X.a.append(Y)
Y.a.append(X)
dp = [[None] * (n+1) for _ in range(n+1)]

for i in range(n):
    node = nodes[i]
    q = deque()
    q.append((node, 0))
    done = set()

    while q:
        t = q.popleft()
        node, d = t[0], t[1]

        if node.idx not in done:
            dp[i + 1][node.idx] = d
            done.add(node.idx)
            for adj in node.a:
                q.append((adj, d + 1))

# for i in range(1, n+1):
#     print(dp[i])

for k in range(1, n):
    temp = 0
    for i in range(1, n+1):
        for j in range(1, n+1):
            if dp[i][j] == k:
                temp += 1
    print(temp//2)

Fixed submission:
from collections import deque

class Node:
    def __init__(self, idx):
        self.idx = idx
        self.a = []


n, x, y = map(int, input().split())
nodes = []

for i in range(n):
    node = Node(i+1)
    nodes.append(node)

for i in range(n-1):
    cur = nodes[i]
    next = nodes[i+1]

    cur.a.append(next)
    next.a.append(cur)

X = nodes[x-1]
Y = nodes[y-1]
X.a.append(Y)
Y.a.append(X)
dp = [[None] * (n+1) for _ in range(n+1)]

for i in range(n):
    node = nodes[i]
    q = deque()
    q.append((node, 0))
    done = set()

    while q:
        t = q.popleft()
        node, d = t[0], t[1]

        if node.idx not in done:
            dp[i + 1][node.idx] = d
            done.add(node.idx)
            for adj in node.a:
                q.append((adj, d + 1))

# for i in range(1, n+1):
#     print(dp[i])

m = {}

for i in range(1, n + 1):
    for j in range(1, n + 1):
        dis = dp[i][j]
        if dis in m:
            m[dis] += 1
        else:
            m[dis] = 1

for k in range(1, n):
    if k in m:
        print(m[k] // 2)
    else:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

class Node:
    def __init__(self, idx):
        self.idx = idx
        self.a = []


n, x, y = map(int, input().split())
nodes = []

for i in range(n):
    node = Node(i+1)
    nodes.append(node)

for i in range(n-1):
    cur = nodes[i]
    next = nodes[i+1]

    cur.a.append(next)
    next.a.append(cur)

X = nodes[x-1]
Y = nodes[y-1]
X.a.append(Y)
Y.a.append(X)

for k in range(1, n):
    temp = 0
    for i in range(n):
        node = nodes[i]
        q = deque()
        q.append((node, 0))
        done = set()

        while q:
            t = q.popleft()
            node, d = t[0], t[1]
            if d > k:
                break

            if node.idx not in done:
                done.add(node.idx)
                if d == k:
                    temp += 1
                for adj in node.a:
                    q.append((adj, d+1))
    print(temp//2)

Fixed submission:
from collections import deque

class Node:
    def __init__(self, idx):
        self.idx = idx
        self.a = []


n, x, y = map(int, input().split())
nodes = []

for i in range(n):
    node = Node(i+1)
    nodes.append(node)

for i in range(n-1):
    cur = nodes[i]
    next = nodes[i+1]

    cur.a.append(next)
    next.a.append(cur)

X = nodes[x-1]
Y = nodes[y-1]
X.a.append(Y)
Y.a.append(X)
dp = [[None] * (n+1) for _ in range(n+1)]

for i in range(n):
    node = nodes[i]
    q = deque()
    q.append((node, 0))
    done = set()

    while q:
        t = q.popleft()
        node, d = t[0], t[1]

        if node.idx not in done:
            dp[i + 1][node.idx] = d
            done.add(node.idx)
            for adj in node.a:
                q.append((adj, d + 1))

# for i in range(1, n+1):
#     print(dp[i])

m = {}

for i in range(1, n + 1):
    for j in range(1, n + 1):
        dis = dp[i][j]
        if dis in m:
            m[dis] += 1
        else:
            m[dis] = 1

for k in range(1, n):
    if k in m:
        print(m[k] // 2)
    else:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

class Node:
    def __init__(self, idx):
        self.idx = idx
        self.a = []


n, x, y = map(int, input().split())
nodes = []

for i in range(n):
    node = Node(i+1)
    nodes.append(node)

for i in range(n-1):
    cur = nodes[i]
    next = nodes[i+1]

    cur.a.append(next)
    next.a.append(cur)

X = nodes[x-1]
Y = nodes[y-1]
X.a.append(Y)
Y.a.append(X)

for k in range(1, n):
    temp = 0
    for i in range(n):
        node = nodes[i]
        q = deque()
        q.append((node, 0))
        done = set()

        while q:
            t = q.popleft()
            node, d = t[0], t[1]

            if node.idx not in done:
                done.add(node.idx)
                if d == k:
                    temp += 1
                for adj in node.a:
                    q.append((adj, d+1))
    print(temp//2)


Fixed submission:
from collections import deque

class Node:
    def __init__(self, idx):
        self.idx = idx
        self.a = []


n, x, y = map(int, input().split())
nodes = []

for i in range(n):
    node = Node(i+1)
    nodes.append(node)

for i in range(n-1):
    cur = nodes[i]
    next = nodes[i+1]

    cur.a.append(next)
    next.a.append(cur)

X = nodes[x-1]
Y = nodes[y-1]
X.a.append(Y)
Y.a.append(X)
dp = [[None] * (n+1) for _ in range(n+1)]

for i in range(n):
    node = nodes[i]
    q = deque()
    q.append((node, 0))
    done = set()

    while q:
        t = q.popleft()
        node, d = t[0], t[1]

        if node.idx not in done:
            dp[i + 1][node.idx] = d
            done.add(node.idx)
            for adj in node.a:
                q.append((adj, d + 1))

# for i in range(1, n+1):
#     print(dp[i])

m = {}

for i in range(1, n + 1):
    for j in range(1, n + 1):
        dis = dp[i][j]
        if dis in m:
            m[dis] += 1
        else:
            m[dis] = 1

for k in range(1, n):
    if k in m:
        print(m[k] // 2)
    else:
        print(0)