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

from collections import defaultdict
import sys
input = sys.stdin.readline


def main():
    N, W = map(int, input().split())
    items = [tuple(map(int, input().split())) for _ in range(N)]
    dd = defaultdict(int)
    dd[0] = 0
    for w, v in items:
        for tw, tv in list(dd.items()):
            if tw + w <= W:
                dd[tw + w] = max(tv + v, dd[tw + w])
    print(max(dd.values()))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import numpy as np
    N, W = map(int, input().split())
    ndp = np.zeros(W+1, dtype= np.int64)
    for _ in range(N):
        w, v = map(int,input().split())
        np.maximum(ndp[:-w] + v, ndp[w:], out = ndp[w:])
    else:print(ndp[-1])

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

n=int(input())
l=list(map(int,input().split()))
for i in range(1,n+1):
  print(str(l.index(i)+1)+" ",end="")

### FIXED CODE ###

def main():
  n=int(input())
  l=list(map(int,input().split()))
  k=[0]*n
  for i in range(1,n+1):
    k[l[i-1]-1]=str(i)
  print(" ".join(k))


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

import copy

N, X = map(int, input().split())
cans = list(map(int, input().split()))
oririn_cans = copy.deepcopy(cans)
count = 0
# 奇数インデックスの要素を引いていく
for n in range(1, N, 2):
  if n + 1 == N:
    while cans[n-1] + cans[n] > X:
      cans[n] -= 1
      count += 1  
    continue

  while cans[n-1] + cans[n] > X or cans[n+1] + cans[n] > X:
    cans[n] -= 1
    count += 1

for n in range(0, N, 2):
  if n == 0:
    while cans[n+1] + cans[n] > X:

      cans[n] -= 1
      count += 1  
    continue

  if n + 1 == N:
    while cans[n-1] + cans[n] > X:
      cans[n] -= 1
      count += 1  
    continue

  while cans[n-1] + cans[n] > X or cans[n+1] + cans[n] > X:
    cans[n] -= 1
    count += 1


odd_count = count

count = 0
cans = oririn_cans

# 偶数インデックスの要素を引いていく
for n in range(0, N, 2):
  if n == 0:
    while cans[n+1] + cans[n] > X:

      cans[n] -= 1
      count += 1  
    continue

  if n + 1 == N:
    while cans[n-1] + cans[n] > X:
      cans[n] -= 1
      count += 1  
    continue

  while cans[n-1] + cans[n] > X or cans[n+1] + cans[n] > X:
    cans[n] -= 1
    count += 1

for n in range(1, N, 2):
  if n + 1 == N:
    while cans[n-1] + cans[n] > X:
      cans[n] -= 1
      count += 1  
    continue

  while cans[n-1] + cans[n] > X or cans[n+1] + cans[n] > X:
    cans[n] -= 1
    count += 1

even_count = count
print(min(odd_count, even_count))

### FIXED CODE ###

# def calc(ran, count, cans, X):
#   for n in ran:
#     if n == 0:
#       while cans[n+1] + cans[n] > X:
#         cans[n] -= 1
#         count += 1  
#       continue
#     if n + 1 == N:
#       while cans[n-1] + cans[n] > X:
#         cans[n] -= 1
#         count += 1  
#       continue
#     while cans[n-1] + cans[n] > X or cans[n+1] + cans[n] > X:
#       cans[n] -= 1
#       count += 1
#   return count, cans

# N, X = map(int, input().split())
# cans = list(map(int, input().split()))

# count = 0

# # odd_range = range(1, N, 2)
# # even_range = range(0, N, 2)
# # count, cans = calc(odd_range, count, cans, X)
# # count, cans = calc(even_range, count, cans, X)

# # even_count = count
# # print(min(odd_count, even_count))

# for i in range(0, N-1):
#   if cans[i] + cans[i+1] > X:
#     cans[i+1] -= X - cans[i]
#     count += 1
# print(count)
n, x = map(int, input().split())
l = list(map(int, input().split()))
 
y = 0
if l[0] > x:
    w = l[0] - x
    y += w
    l[0] -= w
 
for i in range(n-1):
    if l[i] + l[i+1] > x:
        z = l[i+1] + l[i] - x
        y += z
        l[i+1] -= z
 
print(y)
### BUGGY CODE ###

n = int(input())
h = list(map(int,input().split()))
count = [0] * n

for j in range(n):
	for i in range(j,n-1):
		if h[i] >= h[i+1]:
			count[j] += 1
		else:
			i = j
			break

print(max(count))


### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
count = [0] * n
MAX = 0

j = 0
for i in range(j,n-1):
	if h[i] >= h[i+1]:
		count[j] += 1
	else:
		j += 1

for i in range(n):
	if MAX < count[i]:
		MAX = count[i]
	i = count[i] + 2

print(MAX)
### BUGGY CODE ###

import sys

input = sys.stdin.read

def main(H, N, tmp):
    damage = tmp[::2]
    magic = tmp[1::2]
    DP = [float('inf')] * 20001
    DP[0] = 0
    for i in range(20001):
        for j in range(N):
            s = i - damage[j]
            if s >= 0:
                DP[i] = min(DP[i], DP[s] + magic[j])
    return min(DP[H:])


if __name__ == "__main__":
    H, N, *tmp = map(int, input().split())
    ans = main(H, N, tmp)
    print(ans)


### FIXED CODE ###

import sys

input = sys.stdin.read

def main(H, N, tmp):
    damage = tmp[::2]
    magic = tmp[1::2]
    DP = [float('inf')] * 20001
    DP[0] = 0
    for i in range(20001):
        for j in range(N):
            s = i - damage[j]
            if s >= 0:
                DP[i] = min(DP[i], DP[s] + magic[j])
    return min(DP[H:])


if __name__ == "__main__":
    H, N, *tmp = map(int, input().split())
    ans = main(H, N, tmp)
    print(ans)
### BUGGY CODE ###

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

count1 = 0
for i in range(N):
    for j in range(i + 1, N):
        if A[i] > A[j]:
            count1 += 1

A2 = A + A[::]
# count2 = 0
# for i in range(N * 2):
#     for j in range(i + 1, N * 2):
#         if A2[i] > A2[j]:
#             count2 += 1

count2 = count1
for i in range(N):
    for j in range(i + 1, N * 2):
        if A2[i] > A2[j]:
            count2 += 1


A3 = A + A[::] + A[::]
# count3 = 0
# for i in range(N * 3):
#     for j in range(i + 1, N * 3):
#         if A3[i] > A3[j]:
#             count3 += 1

count3 = count2
for i in range(N):
    for j in range(i + 1, N * 3):
        if A3[i] > A3[j]:
            count3 += 1

diff1 = count2 - count1
diff2 = count3 - count2
diffx = diff2 - diff1

bn_last = diff1 + diffx * (K - 2)
bn_sum = ((diff1 + bn_last) * (K - 1)) // 2
an_sum = count1 + bn_sum

if K == 1:
    print(count1)
elif K == 2:
    print(count2)
else:
    print(an_sum % ((10 ** 9) + 7))


### FIXED CODE ###

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

count1 = 0
for i in range(N):
    for j in range(i + 1, N):
        if A[i] > A[j]:
            count1 += 1

count2 = 0
for i in range(N):
    for j in range(N):
        if A[i] > A[j]:
            count2 += 1

# print(count1)
# print(count2)

ans = K * count1 + (count2 * K * (K - 1)) // 2
ans = ans % ((10 ** 9) + 7)
print(ans)
### BUGGY CODE ###

h,w=map(int,input().split())
n=h*w
inf=10**6
field=[]
for i in range(h):
    field.append(input())
dist=[[inf]*n for i in range(n)]
for i in range(h):
    for j in range(w):
        if field[i][j]=="#":continue
        if j+1<w and field[i][j+1]!="#":
            dist[i*w+j][i*w+j+1]=1
            dist[i*w+j+1][i*w+j]=1
        if i+1<h and field[i+1][j]!="#":
            dist[i*w+j][(i+1)*w+j]=1
            dist[(i+1)*w+j][i*w+j]=1
for i in range(n):
    for j in range(n):
        for k in range(n):
            dist[j][k]=min(dist[j][k],dist[j][i]+dist[i][k])
ans=0
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        if dist[i][j]==inf:
            continue
        ans=max(ans,dist[i][j])
print(ans)

### FIXED CODE ###

h,w=map(int,input().split())
n=h*w
inf=10**6
field=[]
for i in range(h):
    field.append(input())
dist=[[inf]*n for i in range(n)]
for i in range(h):
    for j in range(w):
        if field[i][j]=="#":continue
        if j+1<w and field[i][j+1]!="#":
            dist[i*w+j][i*w+j+1]=1
            dist[i*w+j+1][i*w+j]=1
        if i+1<h and field[i+1][j]!="#":
            dist[i*w+j][(i+1)*w+j]=1
            dist[(i+1)*w+j][i*w+j]=1
for i in range(n):
    for j in range(n):
        for k in range(n):
            dist[j][k]=min(dist[j][k],dist[j][i]+dist[i][k])
ans=0
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        if dist[i][j]==inf:
            continue
        ans=max(ans,dist[i][j])
print(ans)
### BUGGY CODE ###

N = int(input())
S = str(input())

lb = 0
ub = N //2 + 1
while (ub - lb > 1):
    mid = (lb + ub) // 2
    s = []
    for i in range(N - 2*mid + 1):
        s.append(S[mid+i : 2*mid + i])
    for i in range(N - 2*mid + 1):
        if S[i:i+mid] in s:
            flag = True
            break
        else:
            flag = False
            s.pop(0)
    
    if flag == True:
        lb = mid
    else:
        ub = mid
print(lb)

### FIXED CODE ###

N = int(input())
S = str(input())
#N = 13
#S = "strangeorange"

lb = 0
ub = N //2 + 1
flag = False
while (ub - lb > 1):
    mid = (lb + ub) // 2
    s = set()
    for i in range(N - 2*mid + 1):
        s.add(S[i:mid+i])
        if S[mid+i:i+2*mid] in s:
            flag = True
            break
        else:
            flag = False
    if flag == True:
        lb = mid
    else:
        ub = mid
print(lb)
### BUGGY CODE ###

S = input()
ans = len(S)
while 'ST' in S:
    S = S.replace('ST','')


print(len(S))


### FIXED CODE ###

S = input()
ans = len(S)

stack = []
for s in S:

    if s == 'S':
        stack.append(s)
    elif s == 'T' and len(stack) == 0 or stack[-1] == 'T':
        stack.append(s)
    elif s == 'T' and stack[-1] == 'S':
        stack.pop()

print(len(stack))

# #部分点
# while 'ST' in S:
#     num = S.count('ST')
#     S = S.replace('ST','',num)

#print(len(S))
### BUGGY CODE ###

import math
A,B = map(int,input().split())
ans = 1
mid = int(max(A,B)/2)
for i in range(2,mid+2):
    if A % i== 0 and B % i == 0:
        for j in range(2,int(math.sqrt(i)+1)):
            if i % j == 0 and i != j:
                break
        else:
            ans += 1
print(ans)

### FIXED CODE ###

import math

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A,B = map(int,input().split())
a = prime_factorize(A)
b = prime_factorize(B)
ans = 1

while a != []:
    x = a[0]
    if x in b:
        ans+=1
    a = [i for i in a if i != x]

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

N,M = map(int, input().split())
arr = [int(input()) for _ in range(0,M)]

arr = [-1]+arr+[N+1]
from math import factorial
count = 0
for i in range(0,len(arr)-1):
    start,end = arr[i],arr[i+1]
    span = end - start - 2 # the first step is taken by a certain step (with no choice)
    if span < 0:
        count = 0 # impossible
        break 
    nptn = int(span/2)
    regional_count = 0

    for k in range(0,nptn+1):
        regional_count += factorial(span-k) // factorial(k) // factorial(span-2*k)
    
    if count == 0:
        count += regional_count
    else:
        count *= regional_count
print(count % 1000000007)

### FIXED CODE ###

N,M = map(int, input().split())
arr = [int(input()) for _ in range(0,M)]
MOD = 10**9 + 7
stairs = [True for _ in range(0,N+1)]
for x in arr:
    stairs[x] = False

dp = [0 for _ in range(0,N+1)]

dp[0] = 1 if 0 not in arr else 0
dp[1] = 1 if 1 not in arr else 0

for i in range(2,N+1):
    if dp[i-1] == 0 and dp[i-2] == 0:
        break
    if stairs[i-1]: dp[i] += dp[i-1]
    if stairs[i-2]: dp[i] += dp[i-2]

    dp[i] %= MOD

print(dp[-1] % MOD)
### BUGGY CODE ###

import sys
read = sys.stdin.readline


def readln():
    return list(map(int, read().split()))


N, Q = readln()
S = input()

L = []
R = []
for _ in range(Q):
    a, b = readln()
    L.append(a-1)  # indexでアクセスできるように
    R.append(b)

import re

for l, r in zip(L, R):
    s = S[l:r]
    ans = 0
    for s1, s2 in zip(s[:-1], s[1:]):
        if s1 == 'A' and s2 == 'C':
            ans += 1
    print(ans)


### FIXED CODE ###

import sys
read = sys.stdin.readline


def readln():
    return list(map(int, read().split()))


N, Q = readln()
S = input()

L = []
R = []
for _ in range(Q):
    a, b = readln()
    L.append(a-1)  # indexでアクセスできるように
    R.append(b-1)

AC_count = [0] * N  # Sのidxと対応、そこまでにACが何回出てきたか
cnt = 0

for i, (s1, s2) in enumerate(zip(S[:-1], S[1:])):
    if s1 == 'A' and s2 == 'C':
        cnt += 1

    AC_count[i+1] = cnt

for l, r in zip(L, R):
    print(AC_count[r]-AC_count[l])
### BUGGY CODE ###

N = int(input())
list = []
for i in range(N):
  s = str(input())
  for x in list:
    if x == s: break
  else:
    list.append(s)
print(len(list))

### FIXED CODE ###

N = int(input())
List = [str(input()) for i in range(N)] 
print(len(list(set(List))))
### BUGGY CODE ###

import math
n, m = map(int,input().split())
s = input().split()
ss = list(map(int, s))

for i in range(m):
    ss = sorted(ss, reverse = True)
    ss[0] = math.floor(ss[0]/2)

print(sum(ss))


### FIXED CODE ###

import heapq

n, m = map(int,input().split())
s = list(map(int, input().split()))
s = list(map(lambda x: x * (-1), s))
heapq.heapify(s)

for i in range(m):
    mx = heapq.heappop(s) * (-1)
    mx = mx//2
    heapq.heappush(s, mx*(-1))
    
print(sum(s)*(-1))
### BUGGY CODE ###

n,k = map(int,input().split())
li = list(map(int,input().split()))
ans = [0]*n
tmp = [0]*n
#print(ans)
#[0, 0, 0, 0, 0]
for kkk in range(k):
    for i,l in enumerate(li):
        for xx in range(n):
            sa = abs(xx - i)
            #print(sa,l,'sa',i)
            if sa<=l:
                tmp[xx]+=1
    ans = tmp
    li = tmp
    tmp = [0]*n
print(*ans)

### FIXED CODE ###

n,k = map(int,input().split())
li = list(map(int,input().split()))
ans = [0]*(n+1)
tmp = [0]*(n+1)
tmp_sum = []
#print(ans)
#[0, 0, 0, 0, 0]
k = min(k,100)

for kkk in range(k):
    #print(li,'li')
    for i,l in enumerate(li):
        if l != 0:
            start = max(0,i-l)
            end = min(n,i+l+1)
            #print(start,'start',end,'end')
            tmp[start] += 1
            #print(end,len(tmp),'aaa')
            tmp[end] -= 1
    #print(tmp,'tmp')
    last = 0
    for t in tmp:
        last = t+last
        tmp_sum.append(last)
    for i,l in enumerate(li):
        if l == 0:
            tmp_sum[i] += 1
    ans = tmp_sum[:n]
    li = tmp_sum[:n]
    tmp = [0]*(n+1)
    tmp_sum = []
    #if len(set(ans)) == 1:
    #    break
print(*ans)
### BUGGY CODE ###

import sys
from collections import deque
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))

    dg = 10**10

    dp = [[10**5]*n for i in range(2**n)]

    new = set([])
    for i in range(n):
        s = (1<<i)
        dp[s][i] = i
        new.add(s*dg+i)
    

    for k in range(n-1):
        tank = set([])
        for popelt in new:


            s,idx = popelt//dg,popelt%dg
            if (k-idx)%2 == 0:
                fr = a[idx]
            else:
                fr = b[idx]
            cnt = 0
            for j in range(n):
                if (s>>j)&1 == 0:
                    if (j-k)%2 == 1:
                        val = a[j]
                    else:
                        val = b[j]
                    if val >= fr:
                        dp[s+(1<<j)][j] = min(dp[s+(1<<j)][j],dp[s][idx]+j-cnt)
                        tank.add((s+(1<<j))*dg + j)
                else:
                    cnt += 1
            
        new = tank
    
    res = min(dp[2**n-1])

    if res == 10**5:
        print(-1)
    else:
        print(res)





if __name__ == '__main__':
    main()

### FIXED CODE ###



def main():
    import sys
    input = sys.stdin.readline
    n = int(input())
    a = tuple(map(int,input().split()))
    b = tuple(map(int,input().split()))

    dg = 20

    pp = 20

    dp = [10**5]*(10**7)

    new = set([])
    for i in range(n):
        s = (1<<i)
        dp[s*pp+i] = i
        new.add(s*dg+i)

    for k in range(n-1):
        tank = set([])
        if len(new) == 0:
            break
        for popelt in new:
            s,idx = popelt//dg,popelt%dg
            if (k-idx)%2 == 0:
                fr = a[idx]
            else:
                fr = b[idx]
            cnt = 0
            for j in range(n):
                if (s>>j)&1 == 0:
                    if (j-k)%2 == 1:
                        val = a[j]
                    else:
                        val = b[j]
                    if val >= fr and dp[(s+(1<<j))*pp+j] > dp[s*pp+idx]+j-cnt:
                        dp[(s+(1<<j))*pp+j] = dp[s*pp+idx]+j-cnt
                        tank.add((s+(1<<j))*dg + j)
                else:
                    cnt += 1
        new = tank
    
    res = 10**5
    s = (2**n-1)*pp
    for i in range(n):
        if res > dp[s+i]:
            res = dp[s+i]
    if res == 10**5:
        print(-1)
    else:
        print(res)


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

import copy

H, W = map(int, input().split())
S = [[1 if a == '.' else 0 for a in list(input())]  for _ in range(H)]


R = copy.deepcopy(S)
for h in range(H):
    s = 0
    for w in range(W):
        if R[h][w] == 1:
            s += 1
            R[h][w] = s
        else:
            s = 0
    l = 0
    for w in range(W-1, -1, -1):
        if R[h][w] > 0:
            l = max(l, R[h][w])
            R[h][w] = l
        else:
            l = 0

L = copy.deepcopy(S)
for w in range(W):
    s = 0
    for h in range(H):
        if L[h][w] == 1:
            s += 1
            L[h][w] = s
        else:
            s = 0
    l = 0
    for h in range(H-1, -1, -1):
        if L[h][w] > 0:
            l = max(l, L[h][w])
            L[h][w] = l
        else:
            l = 0
ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, L[h][w]+R[h][w]-1)
print(ans)

### FIXED CODE ###

import copy
import sys
input = sys.stdin.readline

H, W = map(int, input().split())
S = [[1 if a == '.' else 0 for a in list(input())]  for _ in range(H)]

def main():
    R = copy.deepcopy(S)
    for h in range(H):
        s = 0
        for w in range(W):
            if R[h][w] == 1:
                s += 1
                R[h][w] = s
            else:
                s = 0
        l = 0
        for w in range(W-1, -1, -1):
            if R[h][w] > 0:
                l = max(l, R[h][w])
                R[h][w] = l
            else:
                l = 0

    L = copy.deepcopy(S)
    for w in range(W):
        s = 0
        for h in range(H):
            if L[h][w] == 1:
                s += 1
                L[h][w] = s
            else:
                s = 0
        l = 0
        for h in range(H-1, -1, -1):
            if L[h][w] > 0:
                l = max(l, L[h][w])
                L[h][w] = l
            else:
                l = 0
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans, L[h][w]+R[h][w]-1)
    print(ans)

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

S=input()
Q=int(input())
import sys
flag=False

for _ in range(Q):
  s = list(sys.stdin.readline())
  if s[0]=="1":
    if flag:
      flag=False
    else:
      flag=True
  else:
    if s[2]=="1":
      if flag:
        S=S+s[4]
      else:
        S=s[4]+S        
    else:
      if flag:
        S=s[4]+S
      else:              
        S=S+s[4]
        
if flag:
  S=S[::-1]
print(S)

### FIXED CODE ###

S=input()
Q=int(input())
import sys
from collections import deque
d=deque()
for _ in S:
  d.append(_)
flag=False

for _ in range(Q):
  s = list(sys.stdin.readline())
  if s[0]=="1":
    if flag:
      flag=False
    else:
      flag=True
  else:
    if s[2]=="1":
      if flag:
        d.append(s[4])
      else:
        d.appendleft(s[4])
    else:
      if flag:
        d.appendleft(s[4])
      else:
        d.append(s[4])
      
if flag:
  d.reverse()
  
print("".join(d))
### BUGGY CODE ###

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

X,H = [],[]
for _ in range(N):
	tx,th = map(int, input().split())
	X.append(tx)
	H.append(th)

import numpy as np
X = np.array(X, np.int64)
H = np.array(H, np.int64)


sortlist = np.argsort(X)
X = X[sortlist]
H = H[sortlist]

ans = 0
for i in range(N):
	if H[i] <= 0:
		continue
	cp = X[i]
	R = cp + (2*D)
	ind = np.searchsorted(X,R, side='right')
	attack = -(-H[i]//A)
	ans += attack
	H[i:ind] -= attack*A

print(ans)


### FIXED CODE ###

import numpy as np
import sys
N, D, A = map(int, input().split())
L = 2 * D
I = np.array(sys.stdin.read().split(), np.int64)
X = I[::2]
H = I[1::2]
sort_ind = np.argsort(X)
X = X[sort_ind]
H = H[sort_ind]
S = np.zeros(N+1, np.int64)
ind = np.searchsorted(X,X+L+1,side = 'left')

atack = 0
ans = 0
for i in range(N):
	atack += S[i]
	H[i] -= atack
	if H[i] > 0:
		atack_cnt = -(-H[i]//A)
		ans += atack_cnt
		tmp = atack_cnt * A
		S[i+1] += tmp
		S[ind[i]] -= tmp

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

A, B, C, X, Y = tuple(map(int, input().split()))

# 大きな値で初期化
TOTAL_MIN = A * X + B * Y + C * (X+Y) * 2
for i in range(X+1):
    for j in range(Y+1):
        k = max(X - i, Y - j) * 2
        total_tmp = A * i + B * j + C * k
        if total_tmp < TOTAL_MIN:
            TOTAL_MIN = total_tmp

print(TOTAL_MIN)


### FIXED CODE ###

A, B, C, X, Y = tuple(map(int, input().split()))

# 大きな値で初期化
TOTAL_MIN = A * X + B * Y + C * (X+Y) * 2

for a in range(X + 1):
    c = (X - a) * 2
    if c // 2 < Y:
        if B < 2 * C:
            b = Y - c // 2
        else:
            b = 0
            c = max(c, Y * 2) 
    else:
        b = 0
    
    total_tmp = A * a + B * b + C * c
    if total_tmp < TOTAL_MIN:
        TOTAL_MIN = total_tmp
        

print(TOTAL_MIN)
### BUGGY CODE ###

from queue import Queue
N, X, Y = map(int, input().split())

X -= 1
Y -= 1

q = Queue()

ans = [0] * N

def BFS(x, cnt):
    if dist[x] != (N + 1):
        return
    cnt += 1
        
    dist[x] = cnt
    for n in range(N):
        if n == (x + 1):
            q.put((n, cnt))

        elif n == (x - 1):
            q.put((n, cnt))

        elif (x == X) and (n == Y):
            q.put((n, cnt))

        elif (x == Y) and (n == X):
            q.put((n, cnt))


for x in range(N):
    dist = [N + 1] * N
    q.put((x, -1))
    while not q.empty():
        BFS(*q.get())

    for i in range(N):
        ans[dist[i]] += 1

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






### FIXED CODE ###

from collections import deque
N, X, Y = map(int, input().split())

X -= 1
Y -= 1

q = deque()

ans = [0] * N

def BFS(x, cnt):
    if dist[x] != (N + 1):
        return
    cnt += 1
        
    dist[x] = cnt
    if x + 1 < N:
        q.append((x + 1, cnt))
    if x - 1 >= 0:
        q.append((x - 1, cnt))
    if x == X:
        q.append((Y, cnt))
    if x == Y:
        q.append((X, cnt))


for x in range(N):
    dist = [N + 1] * N
    q.append((x, -1))
    while q:
        BFS(*q.popleft())

    for i in range(N):
        ans[dist[i]] += 1

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