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

import sys

input = sys.stdin.readline
R, C, K = map(int, input().split())
values = [[0]*C for _ in range(R)]
for _ in range(K):
    r, c, v = map(int, input().split())
    values[r-1][c-1] = v

dp = [[[0]*4 for _ in range(C)] for _ in range(R+1)] # [r, c, とったアイテム]のvの最大値

for r in range(R-1, -1, -1):
    dp[r][C - 1][0] = dp[r + 1][C - 1][3]
    for i in range(1, 4):
        dp[r][C-1][i] = dp[r + 1][C-1][3]+values[r][C-1]
    for c in range(C-2, -1, -1):
        v = values[r][c]
        for i in range(4):
            if i == 0 or v==0:
                dp[r][c][i] = max([dp[r+1][c][3], dp[r][c+1][i]])
            else:
                dp[r][c][i] = max([dp[r + 1][c][3]+v, dp[r][c + 1][i], dp[r][c + 1][i-1] + v])

print(dp[0][0][3])


### FIXED CODE ###

import sys

input = sys.stdin.readline
R, C, K = map(int, input().split())
values = [[0]*C for _ in range(R)]
for _ in range(K):
    r, c, v = map(int, input().split())
    values[r-1][c-1] = v

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

for r in range(R-1, -1, -1):
    # dp[0][r][C - 1] = dp[3][r + 1][C - 1]
    # for i in range(1, 4):
    #    dp[i][r][C-1] = dp[3][r + 1][C-1][3]+values[r][C-1]
    for c in range(C-1, -1, -1):
        v = values[r][c]
        for i in range(4):
            if i == 0 or v == 0:
                dp[i][r][c] = max(dp[3][r+1][c], dp[i][r][c+1])
            else:
                dp[i][r][c] = max(dp[3][r + 1][c]+v, dp[i][r][c + 1], dp[i-1][r][c + 1] + v)

print(dp[3][0][0])
### BUGGY CODE ###

def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

def main():
    n = int(input())
    a_list = [int(_) for _ in input().split()]
    Q = int(input())

    s_list = []
    for q in range(Q):
        b, c = map(int, input().split())
        a_index_list = my_index_multi(a_list, b)
        
        for i in a_index_list:
            a_list[i] = c

        s_list.append(sum(a_list))

    for s in s_list:
        print(s)

main()

### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())
    
    table = [0] * 100001
    
    c = 0
    s = 0
    
    for i in A:
        table[i] += 1
        s += i
    
    for i in range(Q):
        B, C = map(int, input().split())
        c = table[B]
        s += (C - B) * c
        table[C] += table[B]
        table[B] = 0
        print(s)

main()
### BUGGY CODE ###

import itertools
import collections
N = int(input())
S = input()

result = 0
route = [x for _,x in collections.Counter(S).items()]

for i in range(1,len(route)+1):
    xxx = result
    for cb in itertools.combinations(route, i):
        num = 1
        for x in cb:
            num = num * x
        result += num
    if xxx == result:
        break
print(result%(10**9+7))


### FIXED CODE ###

import collections
N = int(input())
S = input()

result = 1
route = [x+1 for _,x in collections.Counter(S).items()]
for x in route:
    result = result*x
print((result-1)%(10**9+7))
### BUGGY CODE ###

n=int(input())
li=list(map(int,input().split()))
ans=0

for i in range(1,n):
    if li[i]>min(li[0:i+1]):
        ans+=1

print(n-ans)

### FIXED CODE ###

n=int(input())
li=list(map(int,input().split()))
ans=0
tmp=li[0]

for i in range(n):
    if li[i]>tmp:
        ans+=1
    else:
        tmp=li[i]

print(n-ans)
### BUGGY CODE ###

import sys
input=sys.stdin.readline

n,k,q=map(int,input().split())

a=[]

for i in range(q):
    a.append(int(input()))
    
b=[k]*n

def calc(n):
    return n-1

for j in a:
    b=list(map(calc,b))
    b[j-1]+=1

for k in b:
    if k<=0:
        print("No")
    else:
        print("Yes")
        


### FIXED CODE ###

import sys
input=sys.stdin.readline

n,k,q=map(int,input().split())

a=[]

for i in range(q):
    a.append(int(input()))
    
b=[k]*n
c=[-q]*n

for j in a:
    c[j-1]+=1

for l in range(n):
    if b[l]+c[l]<=0:
        print("No")
    else:
        print("Yes")
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n,q = map(int, input().split())
# print(n,q)
tree = [[] for _ in range(n)]
for _ in range(n-1):
    a,b = map(int, input().split())
    tree[a-1].append(b)
    tree[b-1].append(a)
px = [ list(map(int,input().split())) for _ in range(q) ]

# print(tree)
# print(px)

c = [0]*n

for i in range(len(px)):
    c[px[i][0]-1] += px[i][1]

# print(c)

# for i in range(1,n):
#     c[i] += c[min(tree[i])-1]

visited = [False]*n
visited[0] = True
# print(visited)
check = visited.count(False)
# print(check)
while check!=0:
    for i in range(1,n):
        # mi = min(tree[i])-1
        for j in range(len(tree[i])):
            node_tmp = tree[i][j]
            if visited[node_tmp-1]==True and visited[i]==False:
                c[i] += c[node_tmp-1]
                visited[i] = True
                # print("OK")
            else:
                pass
                # print("NG")
    check = visited.count(False)

print(" ".join(map(str,c)))

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,q = map(int, input().split())
tree = [[] for _ in range(n)]
for _ in range(n-1):
    a,b = map(int, input().split())
    tree[a-1].append(b)
    tree[b-1].append(a)
# px = [ list(map(int,input().split())) for _ in range(q) ]
c = [0]*n
# for i in range(len(px)):
for _ in range(q):
    p,x = map(int,input().split())
    c[p-1] += x  
visited = [0]*n
cnd = [1]   # current_node
while len(cnd)>0:
    nnd = []
    for j in cnd:
        visited[j-1]=1
        ko = tree[j-1]
        for k in ko:
            if visited[k-1]==0:
                c[k-1] += c[j-1]
                nnd.append(k)
    cnd = nnd
print(" ".join(map(str,c)))
### BUGGY CODE ###

a=input().split()
K=int(a[0])
S=int(a[1])
cnt=0
for X in range(0,K+1):
    for Y in range(X,K+1):
        for Z in range(Y,K+1):
            if X+Y+Z==S and X==Y and Y==Z:
                cnt+=1
            elif X+Y+Z==S and (X==Y or Y==Z or Z==X):
                cnt+=3
            elif X+Y+Z==S:
                cnt+=6
print(cnt)

### FIXED CODE ###

K,S=map(int,input().split())
cnt=0
for X in range(K+1):
  for Y in range(K+1):
    if 0<=S-X-Y and S-X-Y<=K:
      cnt+=1
print(cnt)
### BUGGY CODE ###

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

ans = 0
for i in range(1,n):
    if a[i] < max(a[:i]):
        ans += max(a[:i])-a[i]
print(ans)


### FIXED CODE ###


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

high = [0]*n
for i in range(1,len(a)):
    if a[i] <= a[i-1]:
        dai = a[i-1] - a[i]
        a[i] += dai
        high[i] = dai


print(sum(high))
### BUGGY CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))

ans = 1
# 1つ使わない中で最大公約数が最大のものを求める
for i in range(0, n):
    if i == 0:
        gcd_num = a[1]
    else:
        gcd_num = a[0]
    for j in range(1, n):
        if i == j:
            continue
        gcd_num = fractions.gcd(gcd_num, a[j])
    ans = max(ans, gcd_num)
print(ans)


### FIXED CODE ###

import fractions
n = int(input())
a = [0] + list(map(int, input().split())) + [0]

# 前処理。left, rightでそれぞれ累積gcdを作っておく
left = [0] * (n + 2)
right = [0] * (n + 2)

for i in range(n):
    left[i] = fractions.gcd(left[i - 1], a[i])

for i in range(n, 0, -1):
    right[i] = fractions.gcd(right[i + 1], a[i])

for i in range(1, n):
    right[-i - 1] = fractions.gcd(right[-i], a[-i - 1])

ans = 1
for i in range(1, n + 1):
    ans = max(ans, fractions.gcd(left[i - 1], right[i + 1]))
print(ans)
### BUGGY CODE ###

S = input()
ans = 0
for i in range(len(S)-3):
  for j in range(i+4,len(S)+1):
    if int(S[i:j]) % 2019 == 0:
      ans += 1
print(ans)

### FIXED CODE ###

S = input()[::-1]
digits = 1
num, ans = 0, 0
mod_list = [0] * 2019
mod_list[0] = 1

for c in S:
  num += int(c) * digits
  mod_list[num % 2019] += 1
  digits *= 10
  digits %= 2019

for i in range(2019):
  ans += mod_list[i] * (mod_list[i] - 1) // 2
  
print(ans)
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
A=[format(A[i],'b').rjust(61,'0') for i in range(N)]
zero=[0 for i in range(61)]
one=[0 for i in range(61)]
for i in range(N):
   for j in range(61):
       if A[i][j]=='0':
         zero[60-j]+=1
       if A[i][j]=='1':
         one[60-j]+=1
mod=10**9+7       
ans=0
for i in range(61):
   ans+=zero[i]*one[i]*pow(2,i,mod)
   ans%=mod
print(ans)
       

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
mod=10**9+7
ans=0
for i in range(60):
  X=1<<i
  n=len([1 for a in A if a&X])
  ans+=X*n*(N-n)%mod
  ans%=mod
print(ans)
### BUGGY CODE ###

H, W = map(int, input().split())
grid = []
for i in range(H):
    grid.append(input())

light = [[None for i in range(W)] for j in range(H)]

for i in range(H):
    j = 0
    count = 0
    before = 0
    while j <= W-1:
        if grid[i][j] == ".":
            count += 1
        else:
            for k in range(before, j):
                light[i][k] = count
            light[i][j] = 0
            before = j+1
            count = 0
        j += 1
    else:
        if count >= 0:
            for k in range(before, j):
                light[i][k] = count

light2 = [[None for i in range(W)] for j in range(H)]

for i in range(W):
    j = 0
    count = 0
    before = 0
    while j <= H-1:
        if grid[j][i] == ".":
            count += 1
        else:
            for k in range(before, j):
                light2[k][i] = count
            light2[j][i] = 0
            before = j+1
            count = 0
        j += 1
    else:
        if count >= 0:
            for k in range(before, j):
                light2[k][i] = count

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, light[i][j] + light2[i][j])
print(ans-1)


### FIXED CODE ###

H, W = map(int, input().split())
grid = []
for i in range(H):
    grid.append(input())

light = [[None for i in range(W)] for j in range(H)]

for i in range(H):
    j = 0
    count = 0
    before = 0
    while j <= W-1:
        if grid[i][j] == ".":
            count += 1
        else:
            for k in range(before, j):
                light[i][k] = count
            light[i][j] = 0
            before = j+1
            count = 0
        j += 1
    else:
        if count >= 0:
            for k in range(before, j):
                light[i][k] = count

light2 = [[None for i in range(W)] for j in range(H)]

for i in range(W):
    j = 0
    count = 0
    before = 0
    while j <= H-1:
        if grid[j][i] == ".":
            count += 1
        else:
            for k in range(before, j):
                light2[k][i] = count
            light2[j][i] = 0
            before = j+1
            count = 0
        j += 1
    else:
        if count >= 0:
            for k in range(before, j):
                light2[k][i] = count

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, light[i][j] + light2[i][j])
print(ans-1)
### BUGGY CODE ###


def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(input())
    A = list(map(int, input().split()))

    d = dict()
    for x in A:
        if x in d:
            d[x] += 1
        else:
            d[x] = 1
    A = set(A)

    ans = 0
    while(A):
        x = min(A)
        if d[x] == 1:
            ans += 1
        next = set()
        for y in A:
            if y % x != 0:
                next.add(y)
        A = set()
        A |= next

    print(ans)


main()


### FIXED CODE ###


def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(input())
    A = list(map(int, input().split()))

    d = dict()
    for x in A:
        if x in d:
            d[x] += 1
        else:
            d[x] = 1
    A.sort()

    ans = 0
    M = max(A)
    dp = [True]*(M+1)
    for x in A:
        for xx in range(x+x, M+1, x):
            dp[xx] = False
    for x in A:
        if d[x] == 1 and dp[x]:
            ans += 1
    print(ans)


main()
### BUGGY CODE ###

#A問題
N,M = map(int,input().split())
A = []
mod = 1000000007
for i in range(M):
    A.append(int(input()))

sta = []
for i in range(N+1):
    if i == 0:
        sta.append(1)
    elif i == 1:
        sta.append(1)
    elif i == 2:
        sta.append(2)
    else:
        sta.append(sta[i-1]+sta[i-2])

row = []
now = 1
flag = 0
for i in range(N):
    I = i+1
    if i == 0:
        if I in A:
            now = 0
            flag = 1
        else:
            now+=1
    else:
        if I in A:
            if flag == 1:
                flag = 2
                break
            else:
                row.append(now)
                now = 0
                flag = 1
        else:
            flag = 0
            now+=1

if flag == 2:
    print(0)
else:
    row.append(now)
    ans = 1
    for r in row:
        ans*=sta[r-1]
    print(ans%mod)

### FIXED CODE ###

#C問題
mod = 10**9+7
N,M = map(int,input().split())

step = []
for i in range(N+2):
    if i <= 1:
        step.append(1)
    elif i == 2:
        step.append(1)
    else:
        step.append(step[i-1]+step[i-2])
    
A = []
for j in range(M):
    A.append(int(input()))

stairs = []
flag = 0
old = -1
for a in A:
    if a-old == 1:
        flag = 1
        break
    else:
        stairs.append(a-old-1)
        old = a
stairs.append(N-old)

if flag == 1:
    print(0)
else:
    #print(stairs)
    ans = 1
    for s in stairs:
        ans*=step[s]
        
    print(ans%mod)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
P = [None] + [int(x) for x in input().split()]
p_to_i = [None] * (N+1)
for i,x in enumerate(P[1:],1):
    p_to_i[x] = i

# 大きい数から挿入していく
# 左隣にあるインデックスを取得できるようにしておく
# そのために、[1,i]内で書き込んだ数の個数を獲得できるBITを持つ

def BIT_add(i):
    while i <= N:
        tree[i] += 1
        i += i&(-i)

def BIT_sum(i):
    s = 0
    while i:
        s += tree[i]
        i -= i&(-i)
    return s

def BIT_search(x):
    # 二分探索。和がx以上となる最小のインデックス(>= 1)を返す
    i = 0
    s = 0
    step = 1<<(N.bit_length()-1)
    while step:
        if i+step <= N and s + tree[i+step] < x:
            i += step
            s += tree[i]
        step >>= 1
    return i+1

tree = [0] * (N+1)
answer = 0
for x in range(N,0,-1):
    c = p_to_i[x]
    L = BIT_sum(c) # 左にある既に書き込んだ数の個数
    BIT_add(c)
    R = N-x-L # 右にある既に書き込んだ数の個数
    a = BIT_search(L-1) if L >= 2 else 0
    b = BIT_search(L) if L >= 1 else 0
    d = BIT_search(L+2) if R >= 1 else N+1
    e = BIT_search(L+3) if R >= 2 else N+1
    coef = 0
    if b != 0:
        # [b,c]を含むようにする。(a,b) と(c,d)が自由
        coef += (b-a) * (d-c)
    if d != 0:
        # [c,d]を含むようにする。
        coef += (e-d) * (c-b)
    answer += x * coef
print(answer)





### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
P = [None] + [int(x) for x in input().split()]
p_to_i = [None] * (N+1)
for i,x in enumerate(P[1:],1):
    p_to_i[x] = i

# 大きい数から挿入していく
# 左隣にあるインデックスを取得できるようにしておく
# そのために、[1,i]内で書き込んだ数の個数を獲得できるBITを持つ

def BIT_add(i):
    while i <= N:
        tree[i] += 1
        i += i&(-i)

def BIT_sum(i):
    s = 0
    while i:
        s += tree[i]
        i -= i&(-i)
    return s

def BIT_search(x):
    # 二分探索。和がx以上となる最小のインデックス(>= 1)を返す
    i = 0
    s = 0
    step = 1<<(N.bit_length()-1)
    while step:
        if i+step <= N and s + tree[i+step] < x:
            i += step
            s += tree[i]
        step >>= 1
    return i+1

tree = [0] * (N+1)
answer = 0
for x in range(N,0,-1):
    c = p_to_i[x]
    L = BIT_sum(c) # 左にある既に書き込んだ数の個数
    BIT_add(c)
    R = N-x-L # 右にある既に書き込んだ数の個数
    a = BIT_search(L-1) if L >= 2 else 0
    b = BIT_search(L) if L >= 1 else 0
    d = BIT_search(L+2) if R >= 1 else N+1
    e = BIT_search(L+3) if R >= 2 else N+1
    coef = 0
    if b != 0:
        # [b,c]を含むようにする。(a,b) と(c,d)が自由
        coef += (b-a) * (d-c)
    if d != 0:
        # [c,d]を含むようにする。
        coef += (e-d) * (c-b)
    answer += x * coef
print(answer)
### BUGGY CODE ###

#import numpy as np

n = int(input())
A = [list(map(int,input().split())) for i in range(n)]

for i in range(n):
    for j in range(n-1):
        A[i][j] -= 1

#print(A)

S = [0 for i in range(n)]
#F = [[0 for i in range(n)] for j in range(2*n*n)]

n1n = n*(n-1)
nm2 = n - 2
nm1 = n - 1
maxga = n//2

d = 0
for ii in range(n*n*2):
    F = [0] * n
    co = 0
    i = 0
    ga = 0
    for jj in range(n*n*2):
        si = S[i]
        if F[i] == 0 and si <= nm2:
            aite = A[i][si]
            #print(S)
            #print("aite",aite)
            if aite < n and A[aite][S[aite]] == i and F[aite] == 0:
                #print("g", i, aite)
                S[i] += 1
                S[aite] += 1
                F[i] = 1
                F[aite] = 1
                co = 0
                ga += 1
        i = (i+1) % n
        co += 1
        if co == nm1 or ga == maxga:
            break
    d += 1
    #print("d", d)
    if ga == 0:
        if sum(S) == n1n:
            print(d-1)
        else:
            print(-1)
        break



### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
A = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    for j in range(n-1):
        A[i][j] -= 1

AA = [[j for j in i] for i in A]

ID = [[-1] * n for i in range(n)]
id_ = 0
for i in range(n):
    for j in range(i+1,n):
        ID[i][j] = id_
        ID[j][i] = id_
        id_ += 1

for i in range(n):
    for j in range(n-1):
        A[i][j] = ID[i][A[i][j]]

M = [[] for i in range(id_)]
IN = [0] * id_
for i in range(n):
    for j in range(n-2):
        M[A[i][j]].append(A[i][j+1])
        IN[A[i][j+1]] +=1
# print(A)
# print(M)

# 以下、トポロジカルソート

S = []
s = 0

for i in range(id_):
    if IN[i] == 0:
        S.append(i)

while s < len(S):
    for x in M[S[s]]:
        IN[x] -= 1
        # print(x,IN)
        if IN[x] == 0:
            S.append(x)
    s += 1

# print(S)

if len(S) < id_:
    print(-1)
else:
    T = [1] * id_
    for i in range(id_):
        for j in M[S[i]]:
            T[j] = max(T[j], T[S[i]] + 1)
    print(max(T))


# 以下、閉路検出(今は削除)

# V = [0] * id_
# S = [0]
# V[0] = 1

# import sys

# def visit(x):
#     if V[x] == 1:
#         print(-1)
#         sys.exit()
#     elif V[x] == 0:
#         V[x] = 1
#         for i in M[x]:
#             visit(i)
#         V[x] = 2

# for i in range(id_):
#     if V[i] == 0:
#         visit(i)
# print("heironasi")

# 閉路検出ここまで
### BUGGY CODE ###

N = int(input())
H = input().split()

Move = 0

for i in range(N-1):
    tmp = 0
    for j in range(N-i-1):
        if int(H[i+j+1])<=int(H[i+j]):
            #print(H[i+j],H[i+j+1])
            tmp += 1
        else:
            #print(H[i+j],H[i+j+1])
            break
    if Move < tmp:
        Move = tmp
        
print(Move)

### FIXED CODE ###

N = int(input())
H = input().split()

Move = 0
tmp = 0
for i in range(N-1):
    if int(H[i+1]) > int(H[i]):
        if Move <= tmp:
            Move = tmp
        tmp = 0
        
    else:
        tmp += 1     

if Move < tmp:
    Move = tmp

print(Move)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N=int(input())
a = list(map(int, input().split()))
import fractions
ansp = a[0]
ans = 1
for i in range(1, N):
  ansn = ansp * a[i] // fractions.gcd(ansp, a[i])
  ans = (ans * (ansn // ansp))%(10**9+7) + (ansn // a[i])%(10**9+7)
  ans = ans %(10**9+7)
  ansp = ansn
print(ans)


### FIXED CODE ###

from fractions import gcd
N=int(input())
a = list(map(int, input().split()))
lcm = 1
for i in a:
    lcm = lcm * i // gcd(lcm, i)
ans = 0
for i in a:
    ans += (lcm//i)#%(10**9+7)
print(ans%(10**9+7))
### BUGGY CODE ###

N=int(input())
a=list(map(int,input().split()))
b=1
for i in range(N-1):
	if min(a[:i+2])==a[i+1]:
		b+=1
print(b)

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
b=1
c=a[0]
for i in range(N-1):
	if c>a[i+1]:
		b+=1
		c=a[i+1]
print(b)
### BUGGY CODE ###

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

Answer_dict = {}

for i in range(N-2):
  for j in range(i+1,N-1):
    for k in range(j+1,N):
      Answer_dict[S[i]+S[j]+S[k]] = 1

print(len(Answer_dict))

### FIXED CODE ###

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

Answer_dict = {}
used_i = list()
used_j = [[] for j in range(10)]

for i in range(N-2):
  if S[i] in used_i:
    continue

  for j in range(i+1,N-1):
    if S[j] in used_j[int(S[i])]:
      continue

    for k in range(j+1,N):
      Answer_dict[S[i]+S[j]+S[k]] = 1

    used_j[int(S[i])].append(S[j])
  used_i.append(S[i])

print(len(Answer_dict))
### BUGGY CODE ###

def band(i, j, x, y):
  res = 0
  if i <= x and y <= j:#p1
    res += x - i
    res += 1
    res += j - y
  elif i <= x and j <= x:#p2
    res += j - i
  elif y <= i and y <= j:#p3
    res += j - i
  else:
    if i <= x and x <= j and j <= y:#p4
      res += band(i, x, x, y)
      if j - x <= y - j + 1:
        res += j - x
      else:
        res += y - j + 1
    elif x <= i and i <= y and y <= j:#p5
      if y - i <= i - x + 1:
        res += y - i
      else:
        res += i - x + 1
      res += band(y, j, x, y)
    elif x <= i and i <= y and x <= j and j <= y:#p6
      if j - i <= i - x + y - j + 1:
        res += j - i
      else:
        res += i - x + y - j + 1
  return res

d = {}
n, x, y = list(map(int,input().split()))
for i in range(1, n+1):
  for j in range(1, n+1):
    if i < j:
      #print(str(i)+','+str(j)+'  '+str(band(i, j, x, y)))
      if band(i, j, x, y) in d:
        d[band(i, j, x, y)] += 1
      else:
        d[band(i, j, x, y)] = 1
d2 = sorted(d.items())
for i in range(1,n):
  if i in d:
    print(d[i])
  else:
    print('0')

### FIXED CODE ###

n, x, y = list(map(int,input().split()))
d = [0 for i in range(n-1)] 
for i in range(1,n+1):
  for j in range(i+1,n+1):
    d[min([j-i, abs(x-i) + 1 + abs(j-y), abs(y-i) + 1 + abs(j-x)])-1] += 1

for i in d:
  print(i)
### BUGGY CODE ###

# -*- coding:utf-8 -*-
X = int(input())

sosu_list = [2]

for num in range(3,X+1,2):
    if all(num%sosu != 0 for sosu in sosu_list):
        sosu_list.append(num)

if X == sosu_list[-1]:
    print(X)
else:
    if X % 2 ==0:
        X+=1
    while True:
        if all(X%sosu != 0 for sosu in sosu_list):
            print(X)
            break
        X += 2


### FIXED CODE ###

# -*- coding:utf-8 -*-
X = int(input())

sosu_list = [2]

for num in range(3,X+1,2):
    if all(num%sosu != 0 for sosu in sosu_list):
        sosu_list.append(num)

if X == sosu_list[-1]:
    print(X)
else:
    if X % 2 ==0:
        X+=1
    while True:
        if all(X%sosu != 0 for sosu in sosu_list):
            print(X)
            break
        X += 2