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


class Graph(object):
    """
    隣接リストによる無向グラフ
    重み無しで距離は１
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst):
        self.graph[src].append(dst)
        self.graph[dst].append(src)

    def get_nodes(self):
        return self.graph.keys()


if __name__ == "__main__":
    n, x, y = map(int, input().split())
    x -= 1
    y -= 1

    g = Graph()
    for i in range(n-1):
        g.add_edge(i, i+1)
    g.add_edge(x, y)

    ans = [0] * (n-1)

    # BFSによる解法
    for i in range(n-1):
        # 始点からの距離
        # -1を未訪問とする
        dist = [-1] * n

        # 初期条件
        # 今回は頂点iから探索を行う
        dist[i] = 0
        que = deque([i])

        while len(que) != 0:
            vertex = que.popleft()
            for v in g.graph[vertex]:
                if dist[v] != -1:
                    pass
                else:
                    tmp = dist[vertex] + 1
                    dist[v] = tmp
                    if v > i:
                        ans[tmp-1] += 1
                    que.extend(g.graph[vertex])

    for a in ans:
        print(a)


Fixed submission:
from collections import deque
from collections import defaultdict


class Graph(object):
    """
    隣接リストによる無向グラフ
    重み無しで距離は１
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst):
        self.graph[src].append(dst)
        self.graph[dst].append(src)

    def get_nodes(self):
        return self.graph.keys()


if __name__ == "__main__":
    n, x, y = map(int, input().split())
    x -= 1
    y -= 1

    g = Graph()
    for i in range(n-1):
        g.add_edge(i, i+1)
    g.add_edge(x, y)

    ans = [0] * (n-1)

    # BFSによる解法
    for i in range(n-1):
        # 始点からの距離
        # -1を未訪問とする
        dist = [-1] * n

        # 初期条件
        # 今回は頂点iから探索を行う
        dist[i] = 0
        que = deque([i])

        while len(que) != 0:
            vertex = que.popleft()
            for v in g.graph[vertex]:
                if dist[v] != -1:
                    pass
                else:
                    tmp = dist[vertex] + 1
                    dist[v] = tmp
                    if v > i:
                        ans[tmp-1] += 1
                    que.extend(g.graph[vertex])

    for a in ans:
        print(a)

Buggy python submission (verdict: Time Limit Exceeded):
def warshall_floyd(d):
    for k in range(len(d)):
        for i in range(len(d)):
            for j in range(len(d)):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
    return d


if __name__ == "__main__":
    n, x, y = map(int, input().split())

    INF = 10 ** 5

    d = [[INF] * n for _ in range(n)]

    for i in range(n-1):
        d[i][i+1] = 1
        d[i+1][i] = 1

    d[x-1][y-1] = 1
    d[y-1][x-1] = 1

    ans = [0] * (n - 1)

    d = warshall_floyd(d)

    for i in range(n-1):
        for j in range(i+1, n):
            ans[d[i][j]-1] += 1

    for aa in ans:
        print(aa)


Fixed submission:
from collections import deque
from collections import defaultdict


class Graph(object):
    """
    隣接リストによる無向グラフ
    重み無しで距離は１
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst):
        self.graph[src].append(dst)
        self.graph[dst].append(src)

    def get_nodes(self):
        return self.graph.keys()


if __name__ == "__main__":
    n, x, y = map(int, input().split())
    x -= 1
    y -= 1

    g = Graph()
    for i in range(n-1):
        g.add_edge(i, i+1)
    g.add_edge(x, y)

    ans = [0] * (n-1)

    # BFSによる解法
    for i in range(n-1):
        # 始点からの距離
        # -1を未訪問とする
        dist = [-1] * n

        # 初期条件
        # 今回は頂点iから探索を行う
        dist[i] = 0
        que = deque([i])

        while len(que) != 0:
            vertex = que.popleft()
            for v in g.graph[vertex]:
                if dist[v] != -1:
                    pass
                else:
                    tmp = dist[vertex] + 1
                    dist[v] = tmp
                    if v > i:
                        ans[tmp-1] += 1
                    que.extend(g.graph[vertex])

    for a in ans:
        print(a)

Buggy python submission (verdict: Time Limit Exceeded):
def warshall_floyd(d):
    for k in range(len(d)):
        for i in range(len(d)):
            for j in range(len(d)):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
    return d


if __name__ == "__main__":
    n, x, y = map(int, input().split())

    INF = 10 ** 5

    d = [[INF] * n for _ in range(n)]

    for i in range(n-1):
        d[i][i+1] = 1
        d[i+1][i] = 1

    d[x-1][y-1] = 1
    d[y-1][x-1] = 1

    ans = [0] * (n - 1)

    d = warshall_floyd(d)

    for i in range(n-1):
        for j in range(i+1, n):
            ans[d[i][j]-1] += 1

    for aa in ans:
        print(aa)


Fixed submission:
from collections import deque
from collections import defaultdict


class Graph(object):
    """
    隣接リストによる無向グラフ
    重み無しで距離は１
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst):
        self.graph[src].append(dst)
        self.graph[dst].append(src)

    def get_nodes(self):
        return self.graph.keys()


if __name__ == "__main__":
    n, x, y = map(int, input().split())
    x -= 1
    y -= 1

    g = Graph()
    for i in range(n-1):
        g.add_edge(i, i+1)
    g.add_edge(x, y)

    ans = [0] * (n-1)

    # BFSによる解法
    for i in range(n-1):
        # 始点からの距離
        # -1を未訪問とする
        dist = [-1] * n

        # 初期条件
        # 今回は頂点iから探索を行う
        dist[i] = 0
        que = deque([i])

        while len(que) != 0:
            vertex = que.popleft()
            for v in g.graph[vertex]:
                if dist[v] != -1:
                    pass
                else:
                    tmp = dist[vertex] + 1
                    dist[v] = tmp
                    if v > i:
                        ans[tmp-1] += 1
                    que.extend(g.graph[vertex])

    for a in ans:
        print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
from heapq import heappop, heappush


class Graph(object):
    """
    隣接リストによる有向グラフ
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst, weight=1):
        self.graph[src].append((dst, weight))

    def get_nodes(self):
        return self.graph.keys()


class Dijkstra(object):
    """
    ダイクストラ法（二分ヒープ）による最短経路探索
    計算量: O((E+V)logV)
    """

    def __init__(self, graph, start):
        self.g = graph.graph

        # startノードからの最短距離
        # startノードは0, それ以外は無限大で初期化
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[start] = 0

        # 最短経路での1つ前のノード
        self.prev = defaultdict(lambda: None)

        # startノードをキューに入れる
        self.Q = []
        heappush(self.Q, (self.dist[start], start))

        while self.Q:
            # 優先度（距離）が最小であるキューを取り出す
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, weight in self.g[u]:
                alt = dist_u + weight
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    self.prev[v] = u
                    heappush(self.Q, (alt, v))

    def shortest_distance(self, goal):
        """
        startノードからgoalノードまでの最短距離
        """
        return self.dist[goal]

    def shortest_path(self, goal):
        """
        startノードからgoalノードまでの最短経路
        """
        path = []
        node = goal
        while node is not None:
            path.append(node)
            node = self.prev[node]
        return path[::-1]


if __name__ == "__main__":
    n, x, y = map(int, input().split())

    g1 = Graph()

    ans = [0] * (n - 1)

    for i in range(n-1):
        g1.add_edge(i, i+1)
        g1.add_edge(i+1, i)

    g1.add_edge(x-1, y-1)
    g1.add_edge(y-1, x-1)

    for i in range(n-1):
        d = Dijkstra(g1, i)
        for j in range(i+1, n):
            ans[d.dist[j]-1] += 1

    for aa in ans:
        print(aa)


Fixed submission:
from collections import deque
from collections import defaultdict


class Graph(object):
    """
    隣接リストによる無向グラフ
    重み無しで距離は１
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst):
        self.graph[src].append(dst)
        self.graph[dst].append(src)

    def get_nodes(self):
        return self.graph.keys()


if __name__ == "__main__":
    n, x, y = map(int, input().split())
    x -= 1
    y -= 1

    g = Graph()
    for i in range(n-1):
        g.add_edge(i, i+1)
    g.add_edge(x, y)

    ans = [0] * (n-1)

    # BFSによる解法
    for i in range(n-1):
        # 始点からの距離
        # -1を未訪問とする
        dist = [-1] * n

        # 初期条件
        # 今回は頂点iから探索を行う
        dist[i] = 0
        que = deque([i])

        while len(que) != 0:
            vertex = que.popleft()
            for v in g.graph[vertex]:
                if dist[v] != -1:
                    pass
                else:
                    tmp = dist[vertex] + 1
                    dist[v] = tmp
                    if v > i:
                        ans[tmp-1] += 1
                    que.extend(g.graph[vertex])

    for a in ans:
        print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
from heapq import heappop, heappush


class Graph(object):
    """
    隣接リストによる有向グラフ
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst, weight=1):
        self.graph[src].append((dst, weight))

    def get_nodes(self):
        return self.graph.keys()


class Dijkstra(object):
    """
    ダイクストラ法（二分ヒープ）による最短経路探索
    計算量: O((E+V)logV)
    """

    def __init__(self, graph, start):
        self.g = graph.graph

        # startノードからの最短距離
        # startノードは0, それ以外は無限大で初期化
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[start] = 0

        # 最短経路での1つ前のノード
        self.prev = defaultdict(lambda: None)

        # startノードをキューに入れる
        self.Q = []
        heappush(self.Q, (self.dist[start], start))

        while self.Q:
            # 優先度（距離）が最小であるキューを取り出す
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, weight in self.g[u]:
                alt = dist_u + weight
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    self.prev[v] = u
                    heappush(self.Q, (alt, v))

    def shortest_distance(self, goal):
        """
        startノードからgoalノードまでの最短距離
        """
        return self.dist[goal]

    def shortest_path(self, goal):
        """
        startノードからgoalノードまでの最短経路
        """
        path = []
        node = goal
        while node is not None:
            path.append(node)
            node = self.prev[node]
        return path[::-1]


if __name__ == "__main__":
    n, x, y = map(int, input().split())

    g1 = Graph()

    ans = [0] * (n - 1)

    for i in range(n-1):
        g1.add_edge(i, i+1)
        g1.add_edge(i+1, i)

    g1.add_edge(x-1, y-1)
    g1.add_edge(y-1, x-1)

    for i in range(n-1):
        d = Dijkstra(g1, i)
        for j in range(i+1, n):
            ans[d.dist[j]-1] += 1

    for aa in ans:
        print(aa)


Fixed submission:
from collections import deque
from collections import defaultdict


class Graph(object):
    """
    隣接リストによる無向グラフ
    重み無しで距離は１
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst):
        self.graph[src].append(dst)
        self.graph[dst].append(src)

    def get_nodes(self):
        return self.graph.keys()


if __name__ == "__main__":
    n, x, y = map(int, input().split())
    x -= 1
    y -= 1

    g = Graph()
    for i in range(n-1):
        g.add_edge(i, i+1)
    g.add_edge(x, y)

    ans = [0] * (n-1)

    # BFSによる解法
    for i in range(n-1):
        # 始点からの距離
        # -1を未訪問とする
        dist = [-1] * n

        # 初期条件
        # 今回は頂点iから探索を行う
        dist[i] = 0
        que = deque([i])

        while len(que) != 0:
            vertex = que.popleft()
            for v in g.graph[vertex]:
                if dist[v] != -1:
                    pass
                else:
                    tmp = dist[vertex] + 1
                    dist[v] = tmp
                    if v > i:
                        ans[tmp-1] += 1
                    que.extend(g.graph[vertex])

    for a in ans:
        print(a)