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

N = int(input())
calc = 1

for i in range(1, N+1):
    calc *= i

print(calc%(10**9+7))

### FIXED CODE ###

N = int(input())
calc = 1
for i in range(1, N+1):
    calc = (i*calc) % (10**9+7)

print(calc)
### BUGGY CODE ###

N = int(input())
edge = [[] for i in range(N)]
for i in range(N-1):
    a, b, c = map(int, input().split())
    edge[a-1].append([c, b-1])
    edge[b-1].append([c, a-1])
Q, K = map(int, input().split())
query = [list(map(int, input().split())) for _ in range(Q)]

import heapq

def dijkstra_heap(s):
    d = [float('inf')] * N
    used = [False] * N
    d[s] = 0
    used[s] = True
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist, e)
    while len(edgelist):
        min_edge = heapq.heappop(edgelist)
        if used[min_edge[1]]:
            continue
        v = min_edge[1]
        d[v] = min_edge[0]
        used[v] = True
        for e in edge[v]:
            heapq.heappush(edgelist, [e[0] + d[v], e[1]])
    return d

dist = dijkstra_heap(K-1)
for q in query:
    x, y = q[0], q[1]
    x -= 1
    y -= 1
    print(dist[x] + dist[y])

### FIXED CODE ###

N = int(input())
edge = [[] for i in range(N)]
for i in range(N-1):
    a, b, c = map(int, input().split())
    edge[a-1].append((c, b-1))
    edge[b-1].append((c, a-1))
Q, K = map(int, input().split())
query = [tuple(map(int, input().split())) for _ in range(Q)]

import heapq

def dijkstra_heap(s):
    d = [10**12] * N
    used = [False] * N
    d[s] = 0
    used[s] = True
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist, e)
    while len(edgelist):
        min_edge = heapq.heappop(edgelist)
        if used[min_edge[1]]:
            continue
        v = min_edge[1]
        d[v] = min_edge[0]
        used[v] = True
        for e in edge[v]:
            heapq.heappush(edgelist, (e[0] + d[v], e[1]))
    return d

dist = dijkstra_heap(K-1)
for q in query:
    x, y = q[0], q[1]
    x -= 1
    y -= 1
    print(dist[x] + dist[y])
### BUGGY CODE ###


def resolve():
    N, M, Q = map(int, input().split())
    cum_A = [[0]*(N+1) for _ in range(N+1)]
    for _ in range(M):
        l, r = map(int, input().split())
        for i in range(r, N+1):
            cum_A[l][i] += 1

    for _ in range(Q):
        ans = 0
        l, r = map(int, input().split())
        ans = sum([cum_A[i][r] - cum_A[i][l-1] for i in range(l, r+1)])

        print(ans)

if __name__ == "__main__":
    resolve()

### FIXED CODE ###


def resolve():
    N, M, Q = map(int, input().split())
    cum_A = [[0]*(N+1) for _ in range(N+1)]
    for _ in range(M):
        l, r = map(int, input().split())
        cum_A[l][r] += 1

    # 二次元累積和
    for i in range(1, N+1):
        for j in range(1, N+1):
            cum_A[i][j] += cum_A[i-1][j] + cum_A[i][j-1] - cum_A[i-1][j-1]

    for _ in range(Q):
        ans = 0
        l, r = map(int, input().split())
        ans = cum_A[r][r] - cum_A[r][l-1] - cum_A[l-1][r] + cum_A[l-1][l-1]

        print(ans)

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

def abc114_c():
  n = int(input())

  def bit_mask(n):
    b, d = 4, 9  # bit, digit
    arr = []
    for i in range(d-1, -1, -1):
      arr.append(n // (b**i))
      n = n % (b**i)
    ret = str(int(''.join(map(str, arr))))
    return ret

  def decode753(arr):
    ret = ''.join(map(str, arr)).replace('3','7').replace('2','5').replace('1','3')
    return int(ret)

  ans = 0
  b, d = 4, 9
  for m in range(b**d):
    mask = bit_mask(m)
    if mask.count('0') == 0 and mask.count('1') > 0 and mask.count('2') > 0 and mask.count('3') > 0:
      x = decode753(mask)
      if x <= n: ans += 1
      else: break
  print(ans)

abc114_c()

### FIXED CODE ###

def abc114_c():
  n = int(input())

  def bit_mask(n):
    b, d = 4, 9  # bit, digit
    arr = []
    for i in range(d-1, -1, -1):
      arr.append(n // (b**i))
      n = n % (b**i)
    ret = str(int(''.join(map(str, arr))))
    return ret

  def decode753(arr):
    ret = ''.join(map(str, arr)).replace('3','7').replace('2','5').replace('1','3')
    return int(ret)

  ans = 0
  b, d = 4, 9
  for m in range(b**d):
    mask = bit_mask(m)
    if mask.count('0') == 0 and mask.count('1') > 0 and mask.count('2') > 0 and mask.count('3') > 0:
      x = decode753(mask)
      if x <= n: ans += 1
      else: break
  print(ans)

abc114_c()
### BUGGY CODE ###

from decimal import Decimal

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

prob = Decimal(0)
for i in range(1,N+1):

    for j in range(18):
        if i*2**j >= K:
            prob += Decimal(1/2**j)
            break

print(prob/N)

### FIXED CODE ###

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

csum = 0
for i in range(1,N+1):
    c = 0
    flag = 1
    while flag:
        if i*2**c >= K:
            csum += 1/2**c
            flag = 0
        else:
            c += 1
print(csum/N)
### BUGGY CODE ###

import copy
N=int(input())
A=[]
for i in range(N):
  A.append(int(input()))

for i,x in enumerate(A):
  A_=copy.copy(A)
  del A_[i]
  print(max(A_))

### FIXED CODE ###

import numpy as np
N=int(input())
A=[]
for i in range(N):
  A.append(int(input()))

lenA=len(A)
Amax=max(A)
ind=A.index(Amax)
del A[ind]
Amax2=max(A)

AA=np.repeat(Amax,lenA, axis=0)
AA[ind]=Amax2
for x in AA:
  print(x)
### BUGGY CODE ###

n = int(input())
s = str(input())
ans = 0
cnt = 0
for i in range(n-1):
  start = i
  for j in range(i+1,n):
    if s[start] == s[j]:
      cnt += 1
      start += 1
      if start + cnt - 1 == j:
        ans = max(ans,cnt)
        cnt = 0
        start = i
    else:
      ans = max(ans,cnt)
      cnt = 0
      start = i
print(ans)

### FIXED CODE ###

n,s = int(input()), list(input())
def z_algo(s):
    n = len(s)
    a = [0]*n
    i,j,l = 1,0,n
    a[0] = n
    while i < l:
        while i+j < l and s[j] == s[i+j]:
            j += 1
        if not j:
            i += 1
            continue
        a[i] = j
        k = 1
        while l-i > k < j-a[k]:
            a[i+k] = a[k]
            k += 1
        i += k
        j -= k
    return a

ans = 0
for i in range(n-1):
    a = z_algo(s[i:])
    len_a = len(a)
    for j in range(len_a):
        ans = max(ans, min(j,a[j]))
print(ans)
### BUGGY CODE ###

def grid_bfs(h,w,start,maze):
    INF = 10**9+7
    distance = [[INF for _ in range(w)] for _ in range(h)]
    queue = []
    for s in start:
        queue.append(s)
        distance[s[0]][s[1]] = 0
    while len(queue):
        y, x = queue.pop()
        for i in range(0, 4):
            nx, ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]
            if (0 <= nx < w and 0 <= ny < h):
                if (distance[ny][nx] > distance[y][x] + 1):
                    queue.append([ny, nx])
                    distance[ny][nx] = distance[y][x] + 1
    return distance
def examA():
    H, W = LI()
    A = [[1 if a == "#" else 0 for a in SI()] for _ in range(H)]
    start = []
    for i in range(H):
        for j in range(W):
            if A[i][j]==1:
                start.append([i,j])
    D = grid_bfs(H,W,start,A)
#    print(D,V)
    ans = 0
    for v in D:
        ans = max(ans,max(v))
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examA()


### FIXED CODE ###

def grid_bfs(h,w,start,maxD):
    INF = 10**9+7
    distance = [[INF for _ in range(w)] for _ in range(h)]
    queue = deque()
    for s in start:
        queue.append(s)
        distance[s[0]][s[1]] = 0
    while len(queue):
        y, x = queue.popleft()
        for i in range(0, 4):
            nx, ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]
            if (0 <= nx < w and 0 <= ny < h):
                if (distance[ny][nx] > distance[y][x] + 1):
                    queue.append([ny, nx])
                    distance[ny][nx] = distance[y][x] + 1
                    if maxD<distance[ny][nx]:
                        maxD = distance[ny][nx]
    return maxD
def examA():
    H, W = LI()
    A = [[1 if a == "#" else 0 for a in SI()] for _ in range(H)]
    start = []
    for i in range(H):
        for j in range(W):
            if A[i][j]==1:
                start.append([i,j])
    ans = grid_bfs(H,W,start,0)
#    print(D,V)
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

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

import sys
sys.setrecursionlimit(10 ** 7)

WV = []

N, W = [int(v) for v in input().strip().split(' ')]

for _ in range(N):
    WV.append([int(v) for v in input().strip().split(' ')])

def find(w, l):   # あとw持てるときの最大価値（lはすでにナップサックに入っているもの）
    mx = 0
    for i in range(N):
        if w - WV[i][0] < 0 or i in l:
            continue
        mx = max(mx, WV[i][1] + find(w - WV[i][0], l + [i]))
    return mx

print(find(W, []))


### FIXED CODE ###

import numpy as np
import sys

N, W = [int(v) for v in input().strip().split(' ')]
dp = np.zeros(W + 1, dtype = 'uint64')

for _ in range(N):
    w, v = [int(v) for v in sys.stdin.readline().split(' ')]
    np.maximum(dp[:-w] + v, dp[w:], out = dp[w:])

print(dp[W])
### BUGGY CODE ###

N, W = map(int, input().split())
w = [0] * N
v = [0] * N

for i in range(N):
    w[i], v[i] = map(int, input().split())

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

for i in range(N):
    for sum_w in range(W+1):
        if w[i] <= sum_w:
            dp[i+1][sum_w] = max(dp[i][sum_w], dp[i][sum_w - w[i]] + v[i])
        else:
            dp[i+1][sum_w] = dp[i][sum_w]

print(dp[N][W])

### FIXED CODE ###

N, W = map(int, input().split())
w = [0] * N
v = [0] * N

for i in range(N):
    w[i], v[i] = map(int, input().split())

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

for i in range(N):
    for sum_w in range(W+1):
        if w[i] <= sum_w:
            dp[i+1][sum_w] = max(dp[i][sum_w], dp[i][sum_w - w[i]] + v[i])
        else:
            dp[i+1][sum_w] = dp[i][sum_w]

print(dp[N][W])
### BUGGY CODE ###


x = int(input())

diff_old = 1000000000
a = 0
b = 0
count = 0;
while 1:
    a = count
    diff = abs(a ** 5 - abs(x))

    if diff < diff_old:
        diff_old = diff
    else:
        a -= 1
        break
    count += 1

if x < 0:
    a *= -1

r_side = a ** 5 - x

count = 0
if r_side > 0:
    while 1:
        count+=1
        b = count

        if b ** 5 == r_side:
            break
elif r_side < 0:
    while 1:
        count-=1
        b = count

        if b ** 5 == r_side:
            break

print(a, b)

### FIXED CODE ###

x = int(input())

for i in range(200):
    for j in range(-200, 200):
        if i ** 5 - j ** 5 == x:
            a=i
            b=j

print(a, b)
### BUGGY CODE ###

import sys

MOD = 10**9 + 7

n = int(input())

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

sum = 0
for index, i in enumerate(a[:n - 1]):
    for j in a[index + 1:n]:
        sum = (sum + (i * j)) % MOD

print(sum)

### FIXED CODE ###

import sys

MOD = 10**9 + 7

n = int(input())

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

x = pow(sum(a), 2)
y = sum((a[i]**2 for i in range(n)))

sum = (x - y) // 2 % MOD

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

n, m = (int(x) for x in input().split())
A = [int(x) for x in input().split()]

for ticket in range(m):
    A[A.index(max(A))] //= 2

print(sum(A))


### FIXED CODE ###

import heapq

n, m = (int(x) for x in input().split())
A = [int(x) * (-1) for x in input().split()]
heapq.heapify(A)

for ticket in range(m):
    maxval = heapq.heappop(A) * (-1)
    heapq.heappush(A, (maxval//2)*(-1))

print(sum(A) * (-1))
### BUGGY CODE ###

import collections
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
  if i < N - 1:
    A_ = A[:i]
    A_.extend(A[i+1:])
  else:
    A_ = A[:-1]
  c = collections.Counter(A_)
  nums = [c[c_] for c_ in c.keys() if c[c_]  > 1]
  lennum = 0
  for n in nums:
    lennum += n*(n-1) // 2
  print(lennum)

### FIXED CODE ###

import collections
N = int(input())
A = list(map(int, input().split()))
wlists = collections.Counter(A)
sum_num = 0
for i in wlists:
  sum_num += wlists[i] * (wlists[i] - 1) // 2
for i in range(N):
  num = sum_num - wlists[A[i]] * (wlists[A[i]] - 1) // 2
  if wlists[A[i]] > 1:
    num += (wlists[A[i]] - 1) * (wlists[A[i]] - 2) // 2
  print(num)
### BUGGY CODE ###

##C
k = int(input())
number = str(7)
cnt = 1
if k % 2 == 0:
    print(-1)
    exit()
while 1:
    if int(number) % k == 0:
        print(cnt)
        break
    else:
        cnt += 1
        number += str(7)

### FIXED CODE ###

k = int(input())
mod = 7 % k
cnt = 1
answer = -1

for i in range(k):
    if mod == 0:
        answer = cnt
        break
    else:
        cnt += 1
        mod = (mod * 10 + 7) % k
print(answer)
### BUGGY CODE ###

N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1
B=A

if 1 in A:    
    for i in range(1,N+1):
        if i in B:
            S=B.index(i)
            B=A[S::]
            ans =N-i
        else:
            break

print(ans)

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1
x=1

if 1 in A:
    ans = 0
    for i in A:
        if i ==x :
            x += 1
    ans = N - x +1
            
print(ans)
### BUGGY CODE ###

import sys

def merge(A, left, mid, right, num_compare):
	n1 = mid - left
	n2 = right - mid

	L = A[left:mid] + [SENTINEL]
	R = A[mid:right] + [SENTINEL]

	for i in range(n1):
		L[i] = A[left + i]

	for i in range(n2):
		R[i] = A[mid + i]
	
	i = 0
	j = 0

	num_compare += right - left
	for k in range(left, right):
		if L[i] <= R[j]:
			A[k] = L[i]
			i += 1
		else:
			A[k] = R[j]
			j += 1
	return num_compare

def merge_sort(A, left, right, num_compare):
	if left + 1 < right:
		mid = (left + right) // 2
		num_compare = merge_sort(A, left, mid, num_compare)
		num_compare = merge_sort(A, mid, right, num_compare)
		num_compare = merge(A, left, mid, right, num_compare)

	return num_compare


#fin = open("test.txt", "r")
fin = sys.stdin

SENTINEL = float("inf")

n = int(fin.readline())
S = list(map(int, fin.readline().split()))

num_compare = 0
num_compare = merge_sort(S, 0, n, num_compare)

print(S[0], end = "")
for s in S[1:]:
	print(" " + str(s), end = "")
print("") 
print(num_compare)

### FIXED CODE ###

import sys

def merge(A, left, mid, right, num_compare):
	n1 = mid - left
	n2 = right - mid

	L = A[left:mid] + [SENTINEL]
	R = A[mid:right] + [SENTINEL]
	
	i = 0
	j = 0

	num_compare += right - left
	for k in range(left, right):
		if L[i] <= R[j]:
			A[k] = L[i]
			i += 1
		else:
			A[k] = R[j]
			j += 1
	return num_compare

def merge_sort(A, left, right, num_compare):
	if left + 1 < right:
		mid = (left + right) // 2
		num_compare = merge_sort(A, left, mid, num_compare)
		num_compare = merge_sort(A, mid, right, num_compare)
		num_compare = merge(A, left, mid, right, num_compare)

	return num_compare


#fin = open("test.txt", "r")
fin = sys.stdin

SENTINEL = float("inf")

n = int(fin.readline())
S = list(map(int, fin.readline().split()))

num_compare = 0
num_compare = merge_sort(S, 0, n, num_compare)

print(S[0], end = "")
for s in S[1:]:
	print(" " + str(s), end = "")
print("") 
print(num_compare)
### BUGGY CODE ###

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

### 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 ###

import sys
input = sys.stdin.readline

N,Q = [int(i) for i in input().split()]
S = input()

ans = []
for _ in range(Q):
    a,b = [int(i) for i in input().split()]
    ans.append(S[a-1:b].count('AC'))

[print(i) for i in ans]


### FIXED CODE ###

import itertools
N,Q = [int(i) for i in input().split()]
S = list(input())

li = [0]*N
for i in range(N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        li[i+1] = 1
ans = list(itertools.accumulate(li))
k = []
for j in range(Q):
    a,b = [int(i) for i in input().split()]
    k.append(ans[b-1]-ans[a-1])

[print(i) for i in k]
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
Q=int(input())
Gokei=[]

for _ in range(Q):
    B,C=map(int,input().split())
    i=0
    while B in A:
        A.remove(B)
        i+=1
    A.extend([C]*i)
    Gokei.append(sum(A))

for i in range(Q):
    print(Gokei[i])
    i+=1

### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
 
ans = sum(A)
d = Counter(A) #Counterで要素をまとめる
 
for i in range(Q):
    b, c = map(int,input().split())
    tmp = d[b] #bの総数を記憶
    d[b] = 0 #bの総数を0にする
    d[c] += tmp #cの総数にbの総数を足す
    ans += (c-b)*tmp #合計の補正
    print(ans)
### BUGGY CODE ###

n = int(input())
lst1 = list(map(int,input().split()))
mod = 10**9+7

import fractions as math
#リスト l の最大公約数
def lcmlist(l):
    a = l[0]
    for i in range(len(l)):
        #change
        a = (a*l[i]) //math.gcd(a,l[i])
    return a

g = lcmlist(lst1)
ans = 0
for i in range(n):
    ans += g//lst1[i]%mod

print(ans%mod)




### FIXED CODE ###

#互いに素なa,bについて、a*x+b*y=1の一つの解
def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)

def mod_inv(a, m):
    (inv, q, gcd_val) = egcd(a, m)
    return inv % m

import fractions
mod = (10**9)+ 7
n = int(input())
a = list(map(int, input().split()))
lcm = 1
for i in range(n):
    gcd = fractions.gcd(lcm, a[i])
    lcm *= a[i]
    lcm = lcm // gcd
lcm %= mod
ans = 0
for i in range(n):
    k = mod_inv(a[i], mod)
    ans += lcm * k
    ans %= mod
print(ans)
### BUGGY CODE ###

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

flg = []
for i in range(N-2):
    tmp_S = S[i:i+2]
    if tmp_S == 'AC':
        flg.append(1)
    else:
        flg.append(0)

for a in A:
    tmp_f = flg[a[0]-1:a[1]-1]
    print(sum(tmp_f))


### FIXED CODE ###

from itertools import accumulate


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

flg = []
for i in range(N-1):
    tmp_S = S[i:i+2]
    if tmp_S == 'AC':
        flg.append(1)
    else:
        flg.append(0)

# print(flg)
flg2 = [0] + flg
flg2 = list(accumulate(flg2))
# print(flg2)

for a in A:
    print(flg2[a[1]-1] - flg2[a[0]-1])
### BUGGY CODE ###

#import pysnooper
import os,re,sys,operator,math,heapq,string
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy

setrecursionlimit(10**6)

def rec(pp,xx=-1):
    for i in gragh[pp]:
        if i==xx:
            continue
        ans[i]+=ans[pp]
        rec(i,pp)

n,q=map(int,stdin.readline().rstrip().split())
ans=[0]*n
gragh=[[]*n for _ in range(n)]
for i in range(n-1):
    a,b=map(int,stdin.readline().rstrip().split())
    a-=1
    b-=1
    gragh[a].append(b)
    gragh[b].append(a)
for i in range(q):
    p,x=map(int,stdin.readline().rstrip().split())
    ans[p-1]+=x
rec(0)
print(*ans)


### FIXED CODE ###

#import pysnooper
#import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)

def rec(pp,xx=-1):
    for i in gragh[pp]:
        if i==xx:
            continue
        ans[i]+=ans[pp]
        rec(i,pp)

n,q=map(int,stdin.readline().rstrip().split())
ans=[0]*n
gragh=[[]*n for _ in range(n)]
for _ in range(n-1):
    a,b=map(int,stdin.readline().rstrip().split())
    a-=1
    b-=1

    gragh[a].append(b)
    gragh[b].append(a)
for _ in range(q):
    p,x=map(int,stdin.readline().rstrip().split())
    ans[p-1]+=x
rec(0)
print(*ans)
### BUGGY CODE ###

#D

line = [int(x) for x in input().split()]
n = line[0]
x = line[1]
y = line[2]

results =[0]*(n+2)

for i in range(1, n):
    for j in range(i+1,n+1):
        yeet = min([abs(j-i), abs(x-i) + 1 + abs(j-y), abs(y-i) + 1 + abs(j-x)])
        results[yeet-1] += 1

for i in range(0, n-1):
    print(results[i])



### FIXED CODE ###

#D

line = [int(x) for x in input().split()]
n = line[0]
x = line[1]
y = line[2]

results =[0]*(n+2)

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

for i in range(0, n-1):
    print(results[i])
### BUGGY CODE ###

import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    ls = LI()
    ls = sorted(ls, reverse=True)
    ans = 0
    for i in range(n):
        for j in range(i+1, n):
            for h in range(j+1, n):
                # print(ls[i], ls[j], ls[h])
                if ls[i] < ls[j] + ls[h]:
                    # print(ls[i], ls[j], ls[h])
                    ans += 1

    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import bisect

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    ls = LI()
    ls = sorted(ls)
    ans = 0
    for i in range(n):
        for j in range(i):
            ans += j - (bisect.bisect_right(ls[:j], ls[i] - ls[j]))

            # ans += a
            # print(ls[i], ls[j], bisect.bisect_left(ls[:j], ls[i] - ls[j]))
            # if ls[i] < ls[j] + ls[h]:
            #     # print(ls[i], ls[j], ls[h])

    print(ans)

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

from collections import defaultdict
N, X, Y = map(int, input().split())
X -= 1; Y -= 1

pat = defaultdict(int)

for i in range(N):
  for j in range(i+1, N):
    d = min([abs(i-j), abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X)])
    pat[d] += 1

for i in range(1, N):
  print(pat[i])

### FIXED CODE ###


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

pat = [0]*(N-1)

for i in range(N):
  for j in range(i+1, N):
    d = min(abs(i-j), abs(X-i)+1+abs(j-Y))
    pat[d-1] += 1

for i in range(N-1):
  print(pat[i])