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

def hoge():
  from itertools import permutations
  N, M, R = map(int, input().split())
  r = map(int, input().split())
  inf = 1e18
  d = [[inf] * N for i in range(N)]

  for i in range(N):
      d[i][i] = 0

  for i in range(M):
      a, b, c = map(int, input().split())
      a -= 1
      b -= 1
      t = min(c, d[a][b])
      if d[a][b] > c:
          d[a][b], d[b][a] = t, t


  for i in range(N):
      for j in range(N):
          for k in range(N):
              d[i][j] = min(d[i][j], d[i][k] + d[k][j])


  ans = inf
  for i in permutations(r):
      temp = 0
      for j in range(len(i)-1):
          temp += d[i[j]-1][i[j+1]-1]
          if temp > ans:
              break
      ans = min(ans, temp)

  print(ans)
hoge()


### FIXED CODE ###

from itertools import permutations

def input_list():
    return list(map(int, input().split()))

def main():
    n, m, r = input_list()
    rlist = input_list()
    rlist = [r-1 for r in rlist]
    d = [[float('inf')]*n for i in range(n)]
    for i in range(n):
        d[i][i] = 0
    
    for i in range(m):
        a, b, c = input_list()
        d[a-1][b-1] = c
        d[b-1][a-1] = c

    for k in range(n):
        for i in range(n):
            for j in range(n):
                distance = d[i][k]+d[k][j]
                if d[i][j] > distance:
                    d[i][j] = distance

    ans = float('inf')
    for p in permutations(rlist):
        distance = 0
        for i in range(r-1):
            distance += d[p[i]][p[i+1]]

        if ans > distance:
            ans = distance

    print(ans)

main()
### BUGGY CODE ###

from numpy.linalg import solve
N = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x:x * 2, A))


left = [[0] * N for _ in range(N)]
for i in range(N-1):
    for j in range(i, i+2):
        left[i][j] = 1
left[N-1][0] = 1
left[N-1][N-1] = 1

right = A

ans_list = solve(left, right)
ans_list = list(map(lambda x : int(x), ans_list))
print(" ".join(map(str, ans_list)))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

ans_list = [0] * N

wa = sum(A)
A = list(map(lambda x:x * 2, A))
tmp = 0
for i in range(0, N-1, 2):
    tmp += A[i]
ans_list[-1] = wa - tmp
for i in range(N-2, -1, -1):
    ans_list[i] = A[i] - ans_list[i+1]

print(" ".join(map(str, ans_list)))
### BUGGY CODE ###

n,m=map(int,input().split())
k=m//n
s=[]
for i in range(1,int(m**2)+2):
    if m%i==0 and i<=k:
        s.append(i)
        if m/i<=k:
           s.append(m/i)
print(int(max(s)))

### FIXED CODE ###

n, m = list(map(int,input().split()))
def solve():
    for i in range(m//n, 0, -1):
        if m % i == 0:
            if m//i>= n:
                print(i)
                break
solve()
### BUGGY CODE ###

N=int(input())
A=list(map(int, input().split()))
a = 0
S = 0
for i in range(N):
    for j in range(i+1,N):
        a = A[i]*A[j]
        S += a
p = S%1000000007
print(p)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7
a,s = 0,0
for i in range(N):
    a += s*A[i]
    s += A[i]
    a %= mod
print(a)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
def main():
  s = input()
  t = input()
  a = len(s)
  b = len(t)
  dp = [[0]*(b+1) for _ in range(a+1)]
  prev_w = [[0]*(b+1) for _ in range(a+1)]
  for i in range(a):
    for j in range(b):
      if s[i]==t[j]:
        if dp[i][j]+1>dp[i+1][j+1]:
          dp[i+1][j+1] = dp[i][j]+1
          prev_w[i+1][j+1] = [i,j]
      else:
        if dp[i+1][j]>dp[i][j+1]:
          dp[i+1][j+1]=dp[i+1][j]
          prev_w[i+1][j+1] = (i+1,j)
        else:
          dp[i+1][j+1]=dp[i][j+1]
          prev_w[i+1][j+1] = (i,j+1)
  #print(dp[a][b])
  #print(prev_w[1][3])
  ans = ''
  while a!=0 and b !=0:
    l = dp[a][b]
    a,b=prev_w[a][b]
    if l>dp[a][b]:
      ans =s[a]+ans
  print(ans)
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
  import sys
  input = sys.stdin.readline
  ans = []
  ans_append = ans.append
  s = input()
  t = input()
  a = len(s)
  b = len(t)
  dp = [[0]*(b+1) for _ in range(a+1)]
  prev_w = [[None]*(b+1) for _ in range(a+1)]
  for i in range(a):
    for j in range(b):
      if s[i]==t[j]:
        if dp[i][j]+1>dp[i+1][j+1]:
          dp[i+1][j+1] = dp[i][j]+1
          prev_w[i+1][j+1] = (i,j)
      else:
        if dp[i+1][j]>dp[i][j+1]:
          dp[i+1][j+1]=dp[i+1][j]
          prev_w[i+1][j+1] = (i+1,j)
        else:
          dp[i+1][j+1]=dp[i][j+1]
          prev_w[i+1][j+1] = (i,j+1)
  while a!=0 and b !=0:
    l = dp[a][b]
    a,b=prev_w[a][b]
    if l>dp[a][b]:
      ans_append(s[a])
  ans ="".join(ans)
  ans =ans[::-1]
  print(ans)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

from copy import deepcopy
from collections import defaultdict


def main():
    R, C, K = map(int, input().split())
    rcv = [list(map(int, input().split())) for _ in range(K)]

    d = defaultdict(list)
    for r, c, v in rcv:
        d[r].append([c, v])

    for r in d.keys():
        d[r].sort()

    dp = [0] * (C + 1)

    for r, li in sorted(d.items()):
        prev = deepcopy(dp)
        for i, (cs, vs) in enumerate(li):
            mx = 0
            for cg, vg in li[i+1:]:
                val = vs + mx + vg
                dp[cg] = max(dp[cg], prev[cs] + val)
                mx = max(mx, vg)

            dp[cs] = max(dp[cs], prev[cs] + vs)

        for c in range(C):
            dp[c+1] = max(dp[c+1], dp[c])

    ans = dp[C]
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

R, C, K = map(int, input().split())
rcv = [list(map(int, input().split())) for _ in range(K)]

board = [[0] * (C + 1) for _ in range(R + 1)]
for r, c, v in rcv:
    board[r][c] = v

dp = [[[0] * (C + 1) for _ in range(R + 1)] for _ in range(4)]

for r in range(1, R + 1):
    for c in range(1, C + 1):
        v = board[r][c]
        for i in range(4):
            dp[0][r][c] = max(dp[0][r][c], dp[i][r-1][c])
            dp[1][r][c] = max(dp[1][r][c], dp[i][r-1][c] + v)

            dp[i][r][c] = max(dp[i][r][c], dp[i][r][c-1])
            if i > 0:
                dp[i][r][c] = max(dp[i][r][c], dp[i-1][r][c-1] + v)

ans = 0
for i in range(4):
    ans = max(ans, dp[i][R][C])

print(ans)
### BUGGY CODE ###

N = int(input())

ans = 0
for i in range(N,1,-1):
    ans = ans + i-1

print(ans)

### FIXED CODE ###

n=int(input())
print((n-1)*n//2)
### BUGGY CODE ###

import sys,heapq
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
def ddprint(x):
  if DBG:
    print(x)

q = inn()
x = inl()
root = x[1]
b = x[2]
tl = []
tr = []
nl = nr = suml = sumr = 0
ddprint("q " + str(q))
for i in range(1,q):
    #ddprint("i " + str(i))
    x = inl()
    if len(x)==1:
        z = sumr - suml - (root if nr>nl else 0) + b
        print("{} {}".format(root,z))
    else:
        a = x[1]
        b += x[2]
        if nl == nr:
            heapq.heappush(tl,-a)
            suml += a
            a = -heapq.heappop(tl)
            suml -= a
            if a<root:
                a,root = root,a
            heapq.heappush(tr,a)
            sumr += a
            nr += 1
        else:
            heapq.heappush(tr,a)
            sumr += a
            a = heapq.heappop(tr)
            sumr -= a
            if a>root:
                a,root = root,a
            heapq.heappush(tl,-a)
            suml += a
            nl += 1
        #ddprint("b {} root {} nl {} nr {} suml {} sumr {}".format(b,root,nl,nr,suml,sumr))
        #ddprint(tl)
        #ddprint(tr)


### FIXED CODE ###

import heapq
#printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
#inm   = lambda:      map(int, input().split())
DBG = True  and False
#def ddprint(x):
#  if DBG:
#    print(x)

q = inn()
x = inl()
root = x[1]
b = x[2]
tl = []
tr = []
nl = nr = suml = sumr = 0
#ddprint("q " + str(q))
for i in range(1,q):
    #ddprint("i " + str(i))
    x = inl()
    if len(x)==1:
        z = sumr - suml - (root if nr>nl else 0) + b
        print("{} {}".format(root,z))
    else:
        a = x[1]
        b += x[2]
        if nl == nr:
            aa = -heapq.heappushpop(tl,-a)
            suml += a - aa
            if aa<root:
                aa,root = root,aa
            heapq.heappush(tr,aa)
            sumr += aa
            nr += 1
        else:
            aa = heapq.heappushpop(tr,a)
            sumr += a - aa
            if aa>root:
                aa,root = root,aa
            heapq.heappush(tl,-aa)
            suml += aa
            nl += 1
        #ddprint("b {} root {} nl {} nr {} suml {} sumr {}".format(b,root,nl,nr,suml,sumr))
        #ddprint(tl)
        #ddprint(tr)
### BUGGY CODE ###

import sys

f_i = sys.stdin

n, q = map(int, f_i.readline().split())

S = set(frozenset([i]) for i in range(n))

def unite(sets, v1, v2):
    s1 = None
    s2 = None
    t_s = frozenset([v1, v2])
    for s in sets:
        if t_s <= s:
            return None
        elif s1 and s2:
            break
        elif v1 in s:
            s1 = s
        elif v2 in s:
            s2 = s
    sets.discard(s1)
    sets.discard(s2)
    s3 = s1.union(s2)
    sets.add(s3)

def same(sets, v1, v2):
    t_s = frozenset([v1, v2])
    for s in sets:
        if t_s <= s:
            print(1)
            break
        elif v1 in s or v2 in s:
            print(0)
            break

for l in f_i:
    com, x, y = map(int, l.split())
    if com == 0:
        unite(S, x, y)
    else:
        same(S, x, y)

### FIXED CODE ###

import sys
 
f_i = sys.stdin
 
n, q = map(int, f_i.readline().split())

class DisjointSets:
    def __init__(self, size):
        # negative values are roots(representatives of each tree)
        # positive values represent the parent element
        self.table = [-1 for _ in range(size)]

    def _find(self, x):
        while self.table[x] >= 0:
            x = self.table[x]
        return x

    def union(self, x, y):
        s1 = self._find(x)
        s2 = self._find(y)
        if s1 != s2:
            if self.table[s1] < self.table[s2]: # the smaller has more elements
                self.table[s1] += self.table[s2]
                self.table[s2] = s1
            else:
                self.table[s2] += self.table[s1]
                self.table[s1] = s2

    def isSameSet(self, x, y):
        if self._find(x) == self._find(y):
            print(1)
        else:
            print(0)

S = DisjointSets(n)

for l in f_i:
    com, x, y = map(int, l.split())
    if com == 0:
        S.union(x, y)
    else:
        S.isSameSet(x, y)
### BUGGY CODE ###

N,Q = map(int,input().split())
s = str(input())
S = []
for c in s:
    S.append(c)

for i in range(Q):
    l, r = map(int, input().split())
    lst = S[int(l-1):int(r)]
    count = 0
    for i in range(len(lst)-1):
        if (lst[i] == "A")and(lst[i+1] == "C"):
            count += 1
    print(count)

### FIXED CODE ###





import numpy as np

N,Q = map(int,input().split())
S = []
for c in str(input()):
    S.append(c)

a = np.zeros(N)
   
for i in range(1,N):
    if (S[i-1] == "A")and(S[i] == "C"):
        a[i] = a[i-1] + 1
    else:
        a[i] = a[i-1]
        
for i in range(Q):
    l, r = map(int, input().split())
    print(int(a[r-1] - a[l-1]))
### BUGGY CODE ###

N, K = map(int, input().split())
h_list = list(map(int, input().split()))
dp = [float('INF') for i in range(N)]
dp[0] = 0

def change_min(a, b):
  if a > b: return b
  else: return a

for i in range(N):
  for j in range(1, K + 1):
    if i + j > N - 1: continue
    dp[i + j] = change_min(dp[i] + abs(h_list[i] - h_list[i + j]), dp[i + j])

print(dp[N - 1])

### FIXED CODE ###

N, K = map(int, input().split())
h_list = list(map(int, input().split()))
dp = [float('INF') for i in range(N)]
dp[0] = 0

def change_min(a, b):
  if a > b: return b
  else: return a

for i in range(N):
  for j in range(1, K + 1):
    if i + j > N - 1: continue
    dp[i + j] = change_min(dp[i] + abs(h_list[i] - h_list[i + j]), dp[i + j])

print(dp[N - 1])
### BUGGY CODE ###

from collections import deque
X,Y,Z,K=map(int,input().split())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
#AとBのわのうちでかい順にK個
ABsum=deque()
for i in A:
    for j in B:
        ABsum.append(i+j)
ABsum=sorted(list(ABsum),reverse=True)
sumu=deque()
for i in range(min(K,X*Y)):
    for j in C:
        sumu.append(ABsum[i]+j)
sumu=sorted(list(sumu),reverse=True)
for i in range(K):
    print(sumu[i])

### FIXED CODE ###

from collections import deque
X,Y,Z,K=map(int,input().split())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
#AとBのわのうちでかい順にK個
ABsum=[]
for i in A:
    for j in B:
        ABsum.append(i+j)
ABsum=sorted(list(ABsum),reverse=True)
sumu=[]
for i in range(min(K,X*Y)):
    for j in C:
        sumu.append(ABsum[i]+j)
sumu=sorted(list(sumu),reverse=True)
for i in range(K):
    print(sumu[i])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
def dfs(v):
    global gone
    dist = [-1] * (n+1)
    stack = [v]
    dist[v] = 0
    gone[v] = True
    while stack:
        v = stack.pop()
        dw = dist[v] + 1
        for w in graph[v]:
            if dist[w] >= 0:
                continue
            dist[w] = dw
            gone[w] = True
            stack.append(w)

n,m = map(int,input().split())
gone = [False for i in range(n+1)]
graph = [[] for _ in range(n+1)]
for i in range(m):
    x,y,z = map(int,input().split())
    graph[x].append(y)
    graph[y].append(x)

ans = 0

for i in range(1,n+1):
    if gone[i] == False:
        dfs(i)
        ans += 1

print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
def dfs(v):
    global gone
    stack = [v]
    gone[v] = True
    while stack:
        v = stack.pop()
        for w in graph[v]:
            if gone[w] == False:
                stack.append(w)
            gone[w] = True

n,m = map(int,input().split())
exist = [False for i in range(n+1)]
gone = [False for i in range(n+1)]
graph = [[] for _ in range(n+1)]
for i in range(m):
    x,y,z = map(int,input().split())
    graph[x].append(y)
    graph[y].append(x)
    exist[x] = True
    exist[y] = True
ans = 0

for i in range(1,n+1):
    if exist[i] == True:
        if gone[i] == False:
            dfs(i)
            ans += 1
    else:
        ans += 1

print(ans)
### BUGGY CODE ###

import math
r,g,b,n=map(int, input().split()) 
count=0
k=[]
for i in range(n+1):
    for j in range(n+1):
        if n-(i*g+j*r)>=0:
            k.append(i*g+j*r)
        else:
            break
     
for i in range(len(k)):
    if (n-k[i])%b==0:
        count+=1
            
print(count)
            
    
    
            
                
    
        

     

    

     

    


### FIXED CODE ###

import math
r,g,b,n=map(int, input().split()) 
count=0
k=[]
for i in range(n+1):
    for j in range(n+1):
        if n-(i*g+j*r)>=0:
            k.append(i*g+j*r)
        else:
            break
     
for i in range(len(k)):
    if (n-k[i])%b==0:
        count+=1
            
print(count)
### BUGGY CODE ###

import math
N,D,A=map(int,input().split())
l=[]
for i in range(N):
  k=list(map(int,input().split()))
  l.append(k)
l.sort()
ans=0
for i in range(N):
  h=l[i][1]
  if h<=0:continue
  d=l[i][0]+D
  time=math.ceil(h/A)
  s=set()
  for j in range(i,N):
    if abs(d-l[j][0])<=D:
      s.add(j)
    else:break
  for k in s:
    l[k][1]-=time*A
  ans+=time
print(ans)

### FIXED CODE ###

import math
N,D,A=map(int,input().split())
l=[]
for i in range(N):
  k=list(map(int,input().split()))
  l.append(k)
l.sort()
S=[0]*N
ma=[0]*N
tmp=N-1
for i in reversed(range(N)):
  x=l[i][0]
  for j in reversed(range(0,tmp)):
    if abs(l[j][0]-(x-D))>D:
      ma[i]=j+1
      tmp=j+1
      break
  else:
    ma[i]=0
    tmp=0
ans=0
S[0]=math.ceil(l[0][1]/A)
for i in range(1,N):
  h=l[i][1]
  left=S[ma[i]-1] if ma[i]>0 else 0
  right=S[i-1]
  sum_=(right-left)*A
  if h<=sum_:
    S[i]=S[i-1]
    continue
  time=math.ceil((h-sum_)/A)
  S[i]=time+S[i-1]
print(S[N-1])
### BUGGY CODE ###

import sys
input_first = input()
N= int(input_first)

worddic={}

for i in range(N):
    S = input()
    if S in worddic:
        worddic[S] +=1
    else:
        worddic[S] =1

result=[keyval[0] for keyval in worddic.items() if keyval[1]==max(worddic.values())]

result.sort()
for i in result:
    print(i)

    

### FIXED CODE ###

import sys
input_first = input()
N= int(input_first)

worddic={}

for i in range(N):
    S = input()
    if S in worddic:
        worddic[S] +=1
    else:
        worddic[S] =1

# result=[keyval[0] for keyval in worddic.items() if keyval[1]==max(worddic.values())]

maxval = 0
for i in worddic.items():
    if i[1] > maxval :
        maxval = i[1]
        result=[]
        result.append(i[0])
    elif i[1] == maxval:
        result.append(i[0])
    else:
        pass

result.sort()
for i in result:
    print(i)
### BUGGY CODE ###

import itertools

def ff(x,y,z):
    return(x**2+y**2+z**2+x*y+y*z+z*x)

n=int(input())

an=[]
for i, j,k in itertools.product(range(1,42), range(1,42), range(1,42)):
    an.append(ff(i,j,k))
#an=[ff(i,j,k) for i in range(1,42) for j in range(1,42) for k in range(1,42)]
list.sort(an, reverse=True)
for i in range(1,n+1):
    print(an.count(i))

### FIXED CODE ###

def ff(x,y,z):
    return(x**2+y**2+z**2+x*y+y*z+z*x)

n=int(input())
an=[0]*n
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            wk=ff(i,j,k)
            if wk<=n:
                an[wk-1]+=1
for i in an:
    print(i)
### BUGGY CODE ###

N = int(input())
A = []

for i in range(N):
    tmp = int(input())
    if tmp not in A:
        A.append(tmp)
    else:
        A.remove(tmp)

print(len(A))

### FIXED CODE ###

from collections import defaultdict
d = defaultdict(int)

N = int(input())

for i in range(N):
    tmp = input()
    d[tmp] += 1

counter = 0

for j,v in d.items():
    if v % 2 == 1:
        counter += 1

print(counter)
### BUGGY CODE ###

import collections

h, w = list(map(int, input().split()))
smat = [input() for _ in range(h)]

def bfs(x0, y0):
    visited = set()
    deq = collections.deque()
    deq.append((x0, y0, -1))

    mx = 0
    while len(deq) > 0:
        x, y, d = deq.popleft()
        nd = d + 1
        visited.add((x, y))
        mx = max(mx, nd)

        for dx, dy in [(-1, 0), (0, -1), (+1, 0), (0, +1)]:
            nx = x + dx
            ny = y + dy
            if not (0 <= nx < h) or not (0 <= ny < w):
                # bound check
                continue
            if smat[nx][ny] == '#':
                # cell attr check
                continue
            if (nx, ny) in visited:
                # already visited
                continue
            v = (nx, ny, nd)
            deq.append(v)
    
    return mx

mxall = 0
for x0 in range(h):
    for y0 in range(w):
        if smat[x0][y0] == '.':
            mx = bfs(x0, y0)
            mxall = max(mxall, mx)
print(mxall)


### FIXED CODE ###

import collections

h, w = list(map(int, input().split()))
smat = [input() for _ in range(h)]

def bfs(x0, y0):
    visited = [[0 for _ in range(w)] for _ in range(h)]
    deq = collections.deque()
    deq.append((x0, y0, -1))

    mx = 0
    while len(deq) > 0:
        x, y, d = deq.popleft()
        nd = d + 1
        visited[x][y] = 1
        mx = max(mx, nd)

        for dx, dy in [(-1, 0), (0, -1), (+1, 0), (0, +1)]:
            nx = x + dx
            ny = y + dy
            if not (0 <= nx < h) or not (0 <= ny < w):
                # bound check
                continue
            if smat[nx][ny] == '#':
                # cell attr check
                continue
            if visited[nx][ny] == 1:
                # already visited
                continue
            v = (nx, ny, nd)
            deq.append(v)
    
    return mx

if all(all(col == '.' for col in row) for row in smat):
    print((w - 1) + (h - 1))
else:
    mxall = 0
    for x0 in range(h):
        for y0 in range(w):
            if smat[x0][y0] == '.':
                mx = bfs(x0, y0)
                mxall = max(mxall, mx)
    print(mxall)
### BUGGY CODE ###

from bisect import bisect, bisect_left
N = int(input())
L = list(map(int, input().split()))

L.sort()
cnt = 0
for i in range(N-1):
    for j in range(i):
        a, b = L[i], L[j] 
        k = i + 1
        l = bisect_left(L[i+1:], a-b) + i+1
        r = bisect_left(L, a+b)
        cnt += max(r - l, 0)
            
print(cnt)            

### FIXED CODE ###

from bisect import bisect, bisect_left
N = int(input())
L = list(map(int, input().split()))

L.sort()
cnt = 0
for i in range(N-1):
    for j in range(i):
        a, b = L[i], L[j] 
        r = bisect_left(L[i+1:], a+b) + i+1
        cnt += max(r - i - 1, 0)
            
print(cnt)
### BUGGY CODE ###

N,M = list(map(int, input().split()))

a=list(map(int, input().split()))

for x in range(M):
    a[a.index(max(a))] //= 2

total = 0
for x in range(N):
    total+=a[x]

print(total)




### FIXED CODE ###

import math
import heapq
N,M = list(map(int, input().split()))
a=list(map(int, input().split()))

npA = []
for x in a:
    heapq.heappush(npA, -x)

# for x in range(N):
#     print(a[x])
npA.sort()


for x in range(M):
    # temp=heapq.heappop(npA)
    # print("{}//2={}".format(temp,math.ceil(temp/2)))
    heapq.heappush(npA, math.ceil(heapq.heappop(npA)/2))#get the max value!!
    

total = 0
for x in range(N):
    # temp = heapq.heappop(npA)
    # print(temp)
    total+=heapq.heappop(npA)

print(-total)
### BUGGY CODE ###

from collections import deque
N, X, Y = map(int, input().split())
X -= 1
Y -= 1
ans = [0] * N
def BFS(s):
	cnt = [0] * (N+1)
	flg = [-1] * (N+1)
	flg[s] = 0
	q = deque([s])
	while q:
		cp = q.popleft()
		for d in [-1,1]:
			tmp = cp + d
			if (0 <= tmp < N) and (flg[tmp] == -1):
				flg[tmp] = flg[cp] + 1
				ans[flg[tmp]] += 1
				q.append(tmp)
		if cp == X:
			if flg[Y] == -1:
				flg[Y] = flg[cp] + 1
				ans[flg[Y]] += 1
				q.append(Y)
		if cp == Y:
			if flg[X] == -1:
				flg[X] = flg[cp] + 1
				ans[flg[X]] += 1
				q.append(X)
	return cnt

for i in range(N):
	C = BFS(i)

for a in ans[1:]:
	print(a//2)

### FIXED CODE ###

N, X, Y = map(int, input().split())

ans = [0] * N

for i in range(1,N+1):
	q = [i]
	flg = [-1] * (N+1)
	flg[i] = 0
	while q:
		cp = q.pop(0)
		for d in [-1,1]:
			if 1 <= cp+d <= N:
				if flg[cp+d] == -1:
					flg[cp+d] = flg[cp]+1
					ans[flg[cp+d]] += 1
					q.append(cp+d)
		if cp == X:
			if flg[Y] == -1:
				flg[Y] = flg[cp]+1
				ans[flg[Y]] += 1
				q.append(Y)
		if cp == Y:
			if flg[X] == -1:
				flg[X] = flg[cp]+1
				ans[flg[X]] += 1
				q.append(X)

for i in range(1,N):
	print(ans[i]//2)