Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

from copy import deepcopy as dc
N, Q = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(Q)][: : -1]
res = [N * (N - 1) // 2]
mod = 2305843009213693951
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1] * (n + 1)
    self.rnk = [0] * (n + 1)

  def Find_Root(self, x):
    if self.root[x] < 0:
      return x
    else:
      self.root[x] = self.Find_Root(self.root[x])
      return self.root[x]

  def Unite(self, x, y):
    x = self.Find_Root(x)
    y = self.Find_Root(y)
    if x == y:
      return 
    elif self.rnk[x] > self.rnk[y]:
      self.root[x] += self.root[y]
      self.root[y] = x
    else:
      self.root[y] += self.root[x]
      self.root[x] = y
      if self.rnk[x] == self.rnk[y]:
        self.rnk[y] += 1

  def isSameGroup(self, x, y):
    return self.Find_Root(x) == self.Find_Root(y)

  def Count(self, x):
    return -self.root[self.Find_Root(x)]

class Factorial:
  def __init__(self, n, mod):
    self.f=[1]
    for i in range(1, n + 1):
      self.f.append(self.f[-1] * i % mod)
    self.i=[pow(self.f[-1], mod - 2, mod)]
    for i in range(1, n + 1)[: : -1]:
      self.i.append(self.i[-1] * i % mod)
    self.i.reverse()
  def factorial(self, i):
    return self.f[i]
  def ifactorial(self, i):
    return self.i[i]
  def combi(self, n, k):
    return self.f[n] * self.i[n - k] % mod * self.i[k] % mod

uf = UnionFind(N)
f = Factorial(N * (N - 1) // 2, 2305843009213693951)
check = set()
for b in A:
  uf.Unite(b[0], b[1])
  check.add(b[0])
  check.add(b[1])
  tempch = dc(check)
  convenience = 0
  for i in tempch:
    inc = uf.root[i]
    if inc < -1:
      if -inc > N * (N - 1) // 2:
        convenience += 1
      else:
        convenience += f.combi(-inc, 2)
    else:
      check.discard(i)
  res.append(N * (N - 1) // 2 - convenience)
for i in range(Q - 1, -1, -1):
  print(res[i])

### FIXED CODE ###

N, Q = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(Q)]
res = [0] * (Q - 1) + [N * (N - 1) // 2]
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1] * (n + 1)
    self.rnk = [0] * (n + 1)

  def Find_Root(self, x):
    if self.root[x] < 0:
      return x
    else:
      self.root[x] = self.Find_Root(self.root[x])
      return self.root[x]

  def Unite(self, x, y):
    x = self.Find_Root(x)
    y = self.Find_Root(y)
    if x == y:
      return 
    elif self.rnk[x] > self.rnk[y]:
      self.root[x] += self.root[y]
      self.root[y] = x
    else:
      self.root[y] += self.root[x]
      self.root[x] = y
      if self.rnk[x] == self.rnk[y]:
        self.rnk[y] += 1

  def isSameGroup(self, x, y):
    return self.Find_Root(x) == self.Find_Root(y)

  def Count(self, x):
    return -self.root[self.Find_Root(x)]

uf = UnionFind(N)
convenience = [0] * (N + 1)
for i in range(Q - 1, 0, -1):
  res[i - 1] = res[i]
  if uf.Find_Root(A[i][0]) != uf.Find_Root(A[i][1]):
    res[i - 1] -= uf.Count(A[i][0]) * uf.Count(A[i][1])
    a, b = uf.Count(A[i][0]), uf.Count(A[i][1])
    uf.Unite(A[i][0], A[i][1])
  #print(uf.root, res, a, b)
for i in range(Q):
  print(res[i])
### BUGGY CODE ###

import operator
from functools import reduce


def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(operator.mul, range(n, n-r, -1), 1)
    denom = reduce(operator.mul, range(1, r+1), 1)
    return numer // denom


def calc_step2patterns(num_step):
    pats = 0
    for j in range(0, (num_step//2)+1):
        pats += ncr(num_step-j, j)
    return pats


def step2patterns(num_step, step_dict):
    try:
        return step_dict[num_step]
    except KeyError:
        ret = calc_step2patterns(num_step)
        step_dict[num_step] = ret
        return ret


num_stair, num_wet = map(int, input().split(' '))

last_wet = -1
num_pattern = 1
d = {}

for i in range(0, num_wet):
    wet = int(input())
    dry_step = wet - last_wet - 1
    last_wet = wet

    if dry_step <= 0:
        print('0')
        exit(0)

    elif dry_step == 1 or dry_step == 2:
        continue

    else:
        num_pattern *= step2patterns(dry_step - 1, d)

# last step
dry_step = num_stair - last_wet

num_pattern *= step2patterns(dry_step - 1, d)

print(num_pattern % 1000000007)
exit(0)


### FIXED CODE ###

def exec_ncr(max_step, record_dict):
    for i in range(2, max_step+1):
        record_dict[i] = record_dict[i-1] + record_dict[i-2]


num_stair, num_wet = map(int, input().split(' '))

last_wet = -1
num_pattern = 1
d = {0: 1, 1: 1}
exec_ncr(num_stair, d)

for i in range(0, num_wet):
    wet = int(input())
    dry_step = wet - last_wet - 1
    last_wet = wet

    if dry_step <= 0:
        print('0')
        exit(0)

    elif dry_step == 1 or dry_step == 2:
        continue

    else:
        num_pattern *= d[dry_step-1]

# last step
dry_step = num_stair - last_wet

num_pattern *= d[dry_step-1]

print(num_pattern % 1000000007)
exit(0)
### BUGGY CODE ###

def main():
    from collections import Counter
    import sys
    input = sys.stdin.buffer.readline

    _ = int(input())
    A = [int(i) for i in input().split()]

    ans = 0
    A.sort(reverse=True)
    c = dict(Counter(A))

    for b in A:
        if c[b] == 0:
            continue
        a = (1 << b.bit_length()) - b
        if a == b:
            ans += c[b]//2
            c[b] %= 2
        else:
            if a in c.keys() and c[a] > 0:
                cur = min(c[a], c[b])
                ans += cur
                c[b] -= cur
                c[a] -= cur
        # print(a, b, c, ans)

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from collections import Counter
    import sys
    input = sys.stdin.buffer.readline

    _ = int(input())
    A = [int(i) for i in input().split()]

    ans = 0
    A.sort(reverse=True)
    c = Counter(A)

    for b in A:
        if c[b] == 0:
            continue
        a = (2 ** b.bit_length()) - b
        if a == b:
            cur = c[b]//2
        else:
            cur = min(c[a], c[b])
        ans += cur
        c[b] -= cur
        c[a] -= cur
        # print(a, b, c, ans)

    print(ans)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

n,q = map(int,input().split())
s = str(input())
for _ in range(q):
  l,r = map(int,input().split())
  print(s[l-1:r].count("AC"))


### FIXED CODE ###

n,q = map(int,input().split())
s = input()
t = [0] * (n + 1)
for i in range(n):
  t[i+1] = t[i] + (1 if s[i:i+2] == "AC" else 0)
for i in range(q):
  l,r = map(int,input().split())
  print(t[r-1] - t[l-1])
### BUGGY CODE ###

from itertools import permutations

def conv(a):
    return int(a) - 1

N,M,R = map(int,input().split())
rseq = list(map(conv,input().split()))
graph = [[-1]*N for x in range(N)]

for i in range(M):
    A,B,C = map(int,input().split())
    A,B = A-1,B-1
    graph[A][B] = C
    graph[B][A] = C

#FloydWarshall
for k in range(N):
    for i in range(N):
        for j in range(N):
            if graph[i][k] == -1 or graph[k][j] == -1:
                continue
            if graph[i][j] == -1 or graph[i][j] > graph[i][k] + graph[k][j]:
                graph[i][j] = graph[i][k] + graph[k][j]

minimum = 200000000
for p in permutations(rseq):
    total = 0
    for i in range(1,R):
        total += graph[p[i]][p[i-1]]
        if total > minimum:
            break
    if total < minimum:
        minimum = total
print(minimum)


### FIXED CODE ###

from itertools import permutations
 
 
def warshallFloyd(V, dp):
    for k in range(V):
        for i in range(V):
            for j in range(V):
                # dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])
                new_dist = dp[i][k] + dp[k][j]
                if dp[i][j] > new_dist:
                    dp[i][j] = new_dist
 
 
def main():
    N, M, R = [int(x) for x in input().split()]
    destinations = [int(x) for x in input().split()]
    dp = [[float('inf')]*(N+1) for _ in range(N+1)]
    for i in range(N+1):
        dp[i][i] = 0
    for _ in range(M):
        f, t, d = [int(x) for x in input().split()]
        dp[f][t] = dp[t][f] = d
 
    warshallFloyd(N+1, dp)
 
    minimum_cost = float('inf')
    for route in permutations(destinations, len(destinations)):
        cost = 0
        while len(route) > 1:
            f, t = route[0], route[1]
            cost += dp[f][t]
            if cost > minimum_cost:
                break
            route = route[1:]
        if cost < minimum_cost:
            minimum_cost = cost
    print(minimum_cost)
 
 
if __name__ == '__main__':
    main()
### BUGGY CODE ###

N, K = list(map(int, input().split()))
A = list(map(lambda x: int(x) - 1, input().split()))

v = [[-1]*N for i in range(61)]
v[0] = A[:]
now = 0
for i in range(60):
    for j in range(N):
        v[i+1][j] = v[i][v[i][j]]
    if K>>i & 1:
        now = v[i][now]
print(now + 1)

### FIXED CODE ###

N, K = list(map(int, input().split()))
K -= 1
A = list(map(lambda x: int(x) - 1, input().split()))
seen = [None]*N
seen_set = set()
now = 0
for i in range(N):
    seen[i] = now
    seen_set.add(now)
    to = A[now]
    now = to
    if now in seen_set:
        seen[i+1] = now
        loop_s = seen.index(now)
        loop_end = i + 1
        size = loop_end - loop_s
        break
if K <= loop_s:
    print(seen[K+1] + 1)
else:
    K -= loop_s
    print(seen[loop_s + 1 + K % size] + 1)
### BUGGY CODE ###

class RollingHash:
    def __init__(self,S,base,M):
        self.N=len(S)
        self.M=M
        self.H=[0]*(self.N+1)
        self.B=[0]*(self.N+1)
        self.B[0]=1
        for i in range(self.N):
            self.B[i+1]=self.B[i]*base%M
            self.H[i+1]=(self.H[i]*base+(ord(S[i])-96))%M
    def get(self,l,r):
        return (self.H[r]-self.H[l]*self.B[r-l]+self.M)%self.M
    def getall(self,L):
        arr=[]
        for i in range(L,self.N+1):
            arr.append(self.get(i-L,i))
        return arr

def Hash(S,base,M):
    H=0
    for c in S:
        H=(H*base+ord(c)-96)%M
    return H
    
import random
import sys
read=sys.stdin.readline

N=int(input())
M=2**61-1
base=random.randrange(100,M)
RH,S=[],[]
for i in range(N):
    s=read().rstrip()
    S.append(s)
    RH.append(RollingHash(s,base,M))

dic={}
dic[0]=[0]*26
for k,s in enumerate(S):
    Set=set()
    l=len(s)
    for j in range(l):
        Hash=RH[k].get(j,l)
        if not Hash in dic:
            dic[Hash]=[0]*26
        for c in Set:
            dic[Hash][ord(c)-97]+=1
        Set.add(s[j])
    for c in Set:
        dic[0][ord(c)-97]+=1
ans=0
for i,s in enumerate(S):
    Hash=RH[i].get(1,len(s))
    ans+=dic[Hash][ord(s[0])-97]-1
print(ans)

### FIXED CODE ###

class RollingHash:
    def __init__(self,S,base,M):
        self.N=len(S)
        self.M=M
        self.H=[0]*(self.N+1)
        self.B=[0]*(self.N+1)
        self.B[0]=1
        for i in range(self.N):
            self.B[i+1]=self.B[i]*base%M
            self.H[i+1]=(self.H[i]*base+(ord(S[i])-96))%M
    def get(self,l,r):
        return (self.H[r]-self.H[l]*self.B[r-l]+self.M)%self.M

def main():
    import random

    N=int(input())
    M=2**61-1
    base=random.randrange(100,M)
    RH,S=[],[]
    RH,S=[None for i in range(N)],[None]*N
    for i in range(N):
        s=input()
        S[i]=s
        RH[i]=RollingHash(s,base,M)

    dic={}
    dic[0]=[0]*26
    for k,s in enumerate(S):
        Set=set()
        l=len(s)
        for j in range(l):
            Hash=RH[k].get(j,l)
            if not Hash in dic:
                dic[Hash]=[0]*26
            for c in Set:
                dic[Hash][ord(c)-97]+=1
            Set.add(s[j])
        for c in Set:
            dic[0][ord(c)-97]+=1
    ans=0
    for i,s in enumerate(S):
        Hash=RH[i].get(1,len(s))
        ans+=dic[Hash][ord(s[0])-97]-1
    print(ans)

if __name__=='__main__':
    main()
### BUGGY CODE ###

T = int(input())
for _ in range(T):
    N,D = map(int,input().split())
    cookie = [D]
    while len(cookie)<N:
        cookie.sort()
        cookie = cookie[1:] + [127-cookie[0],127]
    print(sum(cookie))

### FIXED CODE ###

T = int(input())
for _ in range(T):
    N,D = map(int,input().split())
    if N%2==0:
        print(N*127-D)
    else:
        print((N-1)*127+D)
### BUGGY CODE ###

import collections as c
n = int(input())
q = c.deque()

for i in range(n - 1):
    a, b, c = map(int, input().split())
    q.append([a-1, b-1, c])

cllist = [-1] * n
a, b, c = q.popleft()
cllist[a] = 0
cllist[b] = c % 2
s = {a, b}
while q:
    a, b, c = q.popleft()
    if a in s:
        cllist[b] = (cllist[a] + (c % 2)) % 2
        s.add(b)
    elif b in s:
        cllist[a] = (cllist[b] + (c % 2)) % 2
        s.add(a)
    else:
        q.append([a, b, c])
for i in cllist:
    print(i)


### FIXED CODE ###

from collections import deque
n = int(input())
q = deque(maxlen=n-1)

for i in range(n - 1):
    a, b, c = map(int, input().split())
    q.append([a-1, b-1, c % 2])

cllist = [-1] * n
a, b, c = q.popleft()
cllist[a] = 0
cllist[b] = c
while q:
    a, b, c = q.popleft()
    if cllist[a] != -1:
        cllist[b] = (cllist[a] + c) % 2
    elif cllist[b] != -1:
        cllist[a] = (cllist[b] + c) % 2
    else:
        q.append([a, b, c])
print(*cllist)
### BUGGY CODE ###

n = int(input())
p = list(map(int, input().split()))
l = []
for i in range(n):
    l.append(min(p[:i + 1]))
print(len(set(l)))

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
cnt = 1
m = p[0]
for i in range(1, n):
    if p[i] <= m:
        cnt += 1
        m = p[i]
print(cnt)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)

n = int(input())
b = list(map(int , input().split()))

def dfs(s, ans):
    #print(s, ans)
    if len(s) == 0:
        print('\n'.join(map(str, reversed(ans))))
        exit()
        return
    for i in range(len(s)):
        if s[i] == i+1:
            s1 = s[:i] + s[i+1:]
            ans.append(s[i])
            dfs(s1, ans)
    if len(ans) > 0:
        ans.pop()

dfs(b, [])

print('-1')


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n = int(input())
b = list(map(int , input().split()))

def dfs(s, ans):
    if len(s) == 0:
        print('\n'.join(map(str, reversed(ans))))
        exit()
        return
    for i in range(len(s)):
        #if s[i] == i+1:
        #if s[i] == i+1 and max(s[:i] + [0]) >= i:
        if s[i] == i+1:
            s1 = s[:i] + s[i+1:]
            allok = True
            for j in range(len(s1)):
                if s1[j] > j+1:
                    allok = False
                    break
            #print(s[:i], s[i+1:],i)
            if allok:
                ans.append(s[i])
                dfs(s1, ans)
    if len(ans) > 0:
        ans.pop()

dfs(b, [])

print('-1')
### BUGGY CODE ###

n = int(input())
edge = []
for _ in range(n-1):
    a,b,c = map(int,input().split())
    edge.append([a-1,b-1,c])
q, k = map(int,input().split())
querry = []
for _ in range(q):
    x,y = map(int,input().split())
    querry.append([x-1,y-1])
    

class Graph():
    def __init__(self,n,edge):
        self.n = n
        self.graph = [[0]*n for _ in range(n)]
        self.edge = edge
        self.ed_list = [[] for _ in range(n)]
        for a,b,c in edge:
            self.ed_list[a].append([b,c])
            self.ed_list[b].append([a,c])
    
    def dijkstra(self,start):
        INF = float('inf')
        cost = [INF]*self.n
        cost[start] = 0
        from heapq import heappop,heappush
        stack = [[0, start]]
        while stack:
            c, x = heappop(stack)
            for to,j in self.ed_list[x]:
                if cost[to] > j + c:
                    cost[to] = j + c
                    heappush(stack,[j + c, to])
        return cost

gp = Graph(n,edge)
cost = gp.dijkstra(k-1)
for i,j in querry:
    print(cost[i] + cost[j])



### FIXED CODE ###

n = int(input())
edge = [list(map(int,input().split())) for _ in range(n-1)]
q, k = map(int,input().split())
querry = [list(map(int,input().split())) for _ in range(q)]
INF = float('inf')
from heapq import heappush,heappop
def dijkstra(n,edge,start):
    ed_list = [[] for _ in range(n)]
    for a,b,c in edge:
        ed_list[a-1].append([b-1,c])
        ed_list[b-1].append([a-1,c])
    cost = [INF]*n
    cost[start] = 0
    stack =[[0,start]]
    while stack:
        c, x = heappop(stack)
        for i,j in ed_list[x]:
            if cost[i] > c + j:
                cost[i] = c + j
                heappush(stack,[c + j, i])
    return cost
arr_cost = dijkstra(n,edge,k-1)
for i,j in querry:
    print(arr_cost[i-1] + arr_cost[j-1])
### BUGGY CODE ###

# AtCoder Beginner Contest 157
# E - Simple String Queries
# https://atcoder.jp/contests/abc157/tasks/abc157_e
from bisect import bisect_left, insort_left
from collections import defaultdict


_, S, _, *Q = open(0).read().split()
S = list(S)
Q = tuple(zip(*[iter(Q)]*3))

D = defaultdict(list)

for i, s in enumerate(S):
    D[s].append(i)

for q, *x in Q:
    if int(q) == 1:
        i, c = x
        i = int(i) - 1

        s, S[i] = S[i], c

        j = bisect_left(D[s], i)
        D[s].pop(j)

        insort_left(D[c], i)

    else:
        l, r = map(int, x)
        l -= 1
        r -= 1
        cnt = 0
        for L in D.values():
            i = bisect_left(L, l)
            if i == len(L):
                continue
            if L[i] <= r:
                cnt += 1

        print(cnt)


### FIXED CODE ###

# AtCoder Beginner Contest 157
# E - Simple String Queries
# https://atcoder.jp/contests/abc157/tasks/abc157_e
from bisect import bisect_left, insort_left
import sys
input = sys.stdin.readline
OFS = ord('a')
_ = input()
S = list(input()[:-1])

D = [[] for _ in [0]*26]
for i, s in enumerate(S):
    D[ord(s)-OFS].append(i)

for _ in [0]*int(input()):
    Q = input()[:-1].split()
    if Q[0] == '1':
        i, c = int(Q[1])-1, Q[2]

        if S[i] != c:
            s = ord(S[i])-OFS
            D[s].pop(bisect_left(D[s], i))
            insort_left(D[ord(c)-OFS], i)
            S[i] = c

    else:
        l, r = int(Q[1])-1, int(Q[2])-1

        cnt = 0
        for L in D:
            i = bisect_left(L, l)
            if i < len(L) and L[i] <= r:
                cnt += 1

        print(cnt)
### BUGGY CODE ###

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
B = list(map(int, input().split()))
B.sort(reverse=True)
C = list(map(int, input().split()))
C.sort(reverse=True)
 
L = []
 
for i in range(min(200,len(A))):
    for j in range(min(200,len(B))):
        for k in range(min(200,len(C))):
            tmp = A[i] + B[j] + C[k]
            L.append(tmp)
 
L.sort(reverse=True)
 
for i in range(K):
    print(L[i])

### FIXED CODE ###

#%%
x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()

bc = [0] * (y * z)
q = 0
for i in range(y):
    for j in range(z):
        bc[q] = b[i] + c[j]
        q += 1

bc.sort(reverse=True)
r = len(bc)
bc = bc[:min(k, r)]

abc = [0] * (x * min(k, r))
q = 0
for i in range(min(k, r)):
    for j in range(x):
        abc[q] = bc[i] + a[j]
        q += 1

abc.sort(reverse=True)
for i in range(min(k, x*y*z)):
    print(abc[i])
### BUGGY CODE ###

n = int(input())
x = input()

popcount = x.count('1')
p = int(x, 2) % (popcount + 1)
q = int(x, 2) % (popcount - 1) if popcount != 1 else 0
for i in range(n):
    if x[i] == '0':
        y = (p + 2**(n-i-1) % (popcount + 1)) % (popcount + 1)
    else:
        if popcount != 1:
            y = (q - 2**(n-i-1) % (popcount - 1)) % (popcount - 1)
        else:
            print(0)
            continue
    cnt = 1
    while y != 0:
        y %= bin(y).count('1')
        cnt += 1
    print(cnt)


### FIXED CODE ###

n = int(input())
x = input()

popcount = x.count('1')
p = int(x, 2) % (popcount + 1)
q = int(x, 2) % (popcount - 1) if popcount != 1 else 0
for i in range(n):
    if x[i] == '0':
        y = (p + pow(2, n-i-1, popcount+1)) % (popcount + 1)
    else:
        if popcount != 1:
            y = (q - pow(2, n-i-1, popcount-1)) % (popcount - 1)
        else:
            print(0)
            continue
    cnt = 1
    while y != 0:
        y %= bin(y).count('1')
        cnt += 1
    print(cnt)
### BUGGY CODE ###

n=int(input())
ans=0
mod=1000000007
list1=list(map(int ,input().split()))
for i in range(n):
  for j in range(i+1,n):
    ans=ans+list1[i]%mod*list1[j]%mod
    
print(ans%mod)

### FIXED CODE ###

n=int(input())
ans=0
mod=10**9+7
list1=list(map(int ,input().split()))
sums=sum(list1)

for i in list1:
  sums -=i
  ans +=sums*i%mod
  
print(ans%mod)
### BUGGY CODE ###

import array
N = int(input())
a = [int(input()) for _ in range(N)]
s = sum(a)
m = (s + 1) // 2

c10 = [0] * (m + 1)
c1 = array.array('l', c10)
c1[m] = 1
for i in range(N):
    d = a[i]
    for j in range(m - d + 1):
        c1[j] = (2 * c1[j] + c1[j + d]) % 998244353
    for j in range(m - d + 1, m + 1):
        c1[j] = (2 * c1[j] + c1[m]) % 998244353

ans1 = c1[0]

if s % 2:
    c1[0] = 0
else:
    for j in range(m):
        c1[j] = 0
    c1[m] = 1
    for i in range(N):
        d = a[i]
        for j in range(m - d + 1):
            c1[j] = (c1[j] + c1[j + d]) % 998244353
        for j in range(m - d + 1, m + 1):
            c1[j] = c1[j]

ans = (3 ** N % 998244353 - 3 * ans1 + 3 * c1[0]) % 998244353
print(ans)

### FIXED CODE ###

import numpy as np

N = int(input())
a = sorted([int(input()) for _ in range(N)])

s = sum(a)
m = (s + 1) // 2
m1 = m + 1


def func():
    ab = np.zeros((N + 1, m1), dtype='int64')
    ab[0, m] = 1
    for i in range(N):
        c = a[i]
        ab[i + 1, :-c] = (2 * ab[i, :-c] + ab[i, c:]) % 998244353
        ab[i + 1, -c:] = (2 * ab[i, -c:] + ab[i, m]) % 998244353
    return ab[N, 0]


def func1():
    ab = np.zeros((N + 1, m1), dtype='int64')
    ab[0, m] = 1
    for i in range(N):
        c = a[i]
        ab[i + 1, :-c] = (ab[i, :-c] + ab[i, c:]) % 998244353 
        ab[i + 1, -c:] = ab[i, -c:]
    return ab[N, 0]


ans = 3 ** N % 998244353 - 3 * func()
if s % 2 == 0:
     ans += 3 * func1()
print(ans % 998244353)
### BUGGY CODE ###

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


def distance(i,j):
    d1 = abs(i-j)
    d2 = abs(i-x)+1+abs(j-y)
    d3 = abs(i-y)+1+abs(j-x)    
    d = min(d1,d2,d3)
    return d

c = []
for i in range(1, n+1):
    for j in range(i+1,n+1):
        c.append(distance(i,j))

for i in range(1,n):
    d = 0
    for j in c:
        if j == i:
            d = d + 1
    print(d)

### FIXED CODE ###


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

d = [0]*(n-1)
for i in range(1, n+1):
    for j in range(i+1,n+1):
        c = min(j-i, abs(i-x)+1+abs(j-y))
        d[c-1] = d[c-1] + 1

for i in d:
    print(i)