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

H,W=map(int,input().split())
S=list(list(input()) for _ in range(H))
ans=0
for i in range(H):
    for j in range(W):
        if S[i][j]!='#' and j!=W-1:
            ans+=1
        elif S[i][j]!='#'and j==W-1 :
            for k in range(ans+1):
                S[i][j-k]=ans+1
            ans=0
        else:
            for k in range(1,ans+1):
                S[i][j-k]=ans
            ans=0
S_t=list(map(list,zip(*S)))
ans=0
for i in range(W):
    for j in range(H):
        if S_t[i][j]!='#' and j!=H-1:
            ans+=1
        elif S_t[i][j]!='#'and j==H-1 :
            for k in range(ans+1):
                S_t[i][j-k]+=ans+1
            ans=0
        else:
            for k in range(1,ans+1):
                S_t[i][j-k]+=ans
            ans=0
            S_t[i][j]=0
c=0
for i in S_t:
    c=max(c,max(i))
print(c-1)

### FIXED CODE ###

H,W=map(int,input().split())
S=list(list(input()) for _ in range(H))
ans=0
for i in S:
    for j in range(W):
        if i[j]!='#' and j!=W-1:
            ans+=1
        elif i[j]!='#'and j==W-1 :
            for k in range(ans+1):
                i[j-k]=ans+1
            ans=0
        else:
            for k in range(1,ans+1):
                i[j-k]=ans
            ans=0
S_t=list(map(list,zip(*S)))
ans=0
for i in S_t:
    for j in range(H):
        if i[j]!='#' and j!=H-1:
            ans+=1
        elif i[j]!='#'and j==H-1 :
            for k in range(ans+1):
                i[j-k]+=ans+1
            ans=0
        else:
            for k in range(1,ans+1):
                i[j-k]+=ans
            ans=0
            i[j]=0
c=0
for i in S_t:
    c=max(c,max(i))
print(c-1)
### BUGGY CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))

import numpy as np

d = [0] * n

if k >= n:
    k = (n - 1)

for i in range(1, k):
    x = []
    for j in range(i):
        x.append(d[j]+np.abs(h[i]-h[j]))
    d[i] = min(x)

for i in range(n-k):
    x = []
    for j in range(k):
        x.append(d[i+j]+np.abs(h[i+k]-h[i+j]))
    d[i+k] = min(x)


print(d[n-1])

### FIXED CODE ###

n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

def frog(n, k, h):
    d = [float('inf')] * n
    d[0] = 0

    for i in range(1, n):
        d[i] = min(
            d[j] + abs(h[i] - h[j]) for j in range(max(i - k, 0), i)
        )
    return d[n - 1]


print(frog(n, k, h))
### BUGGY CODE ###

import sys

n = int(input())
d = list(input())

minNum = sys.maxsize

for i in range(n):
    count = 0
    if i == 0:
        count = d[i+1:].count("E")
    elif i == n-1:
        count = d[:i].count("W")
    else:
        count += d[:i].count("W")
        count += d[i+1:].count("E")
    if count < minNum:
        minNum = count

print(minNum)

### FIXED CODE ###

import sys

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

count = sys.maxsize
ans = S[1:].count("E")

for i in range(N-1):
    count = min(ans, count)
    if S[i] == "W":
        if S[i+1] == "W":
            ans += 1
    elif S[i] == "E":
        if S[i+1] == "E":
            ans -= 1

count = min(ans, count)
print(count)
### BUGGY CODE ###

class Kenken():
	def __init__(self,n,a,b,c,d,s):
		self.n = n
		self.a = a-1
		self.b = b-1
		self.c = c-1
		self.d = d-1
		self.s = s
		self.s = self.s[:a-1] + "A" + self.s[a:]
		self.s = self.s[:b-1] + "B" + self.s[b:]

	def str_replace(self,i,k,S):
		if k == 1:
			self.s = self.s[:i] + "." + S + self.s[i+2:]
		else:
			self.s = self.s[:i] + "." + self.s[i+1] + S + self.s[i+3:]

	def check_stone(self,i):
		if i < self.n:
			if self.s[i] == ".":
				return True
		return False

	def check_goal(self):
		if self.a == self.c and self.b == self.d:
			return False
		else:
			return True

	def left(self,target,i):
		if target == "a":
			self.str_replace(self.a,i,"A")
			self.a += i
		else:
			self.str_replace(self.b,i,"B")
			self.b += i
	
	def get_space(self,S):
		if S == "a":
			return self.a
		elif S == "b":
			return self.b
		elif S == "c":
			return self.c
		elif S == "d":
			return self.d

	def print_all(self):
		print(self.s)

n,a,b,c,d = map(int, input().split())
s = input()

ken = Kenken(n,a,b,c,d,s)
flag=0
while ken.check_goal():
	if (ken.check_stone(ken.get_space("b")+1) and ken.check_stone(ken.get_space("b")-1)) or (ken.get_space("a")+1 == ken.get_space("b") and ken.check_stone(ken.get_space("b")+1)): 
		if ken.check_stone(ken.get_space("a")+1) and ken.get_space("a") != ken.get_space("c"):
			ken.left("a",1)
		elif ken.check_stone(ken.get_space("a")+2) and ken.get_space("a") != ken.get_space("c"):
			ken.left("a",2)
		elif ken.check_stone(ken.get_space("b")+1) and ken.get_space("b") != ken.get_space("d"):
			ken.left("b",1)
		elif ken.check_stone(ken.get_space("b")+2) and ken.get_space("b") != ken.get_space("d"):
			ken.left("b",2)
		else:
			flag=1
			break
	else:
		if ken.check_stone(ken.get_space("b")+1) and ken.get_space("b") != ken.get_space("d"):
			ken.left("b",1)
		elif ken.check_stone(ken.get_space("b")+2) and ken.get_space("b") != ken.get_space("d"):
			ken.left("b",2)
		elif ken.check_stone(ken.get_space("a")+1) and ken.get_space("a") != ken.get_space("c"):
			ken.left("a",1)
		elif ken.check_stone(ken.get_space("a")+2) and ken.get_space("a") != ken.get_space("c"):
			ken.left("a",2)
		else:
			flag=1
			break

if flag == 0:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

n,a,b,c,d = map(int, input().split())
s = input()
if s[a:c-1].count("##")!=0 or s[b:d-1].count("##")!=0:
	print("No")
	exit()

if c > d:
	if s[b-2:d+1].count("...") == 0:
		print("No")
		exit()
print("Yes")
### BUGGY CODE ###

from collections import Counter
N = int(input())
s = [list(input()) for _ in range(N)]
S = []
cnt = 0

for i in range(N):
    mycounter = Counter(S)
    temp = "".join(sorted(s[i]))
    S.append(temp)
    cnt += mycounter[temp]

print(cnt)


### FIXED CODE ###

N = int(input())
s = [list(input()) for _ in range(N)]
S = []
for i in range(N):
    temp = "".join(sorted(s[i]))
    S.append(temp)

D = {}
cnt = 0
for str in S:
    if str in D:
        cnt += D[str]
        D[str] += 1
    else:
        D[str] = 1

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

# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    K = Scanner.int()
    if K % 2 == 0:
        print(-1)
        return
    X = 7
    cnt = 1

    while True:
        if X % K == 0:
            print(cnt)
            return
        cnt += 1
        X = X * 10 + 7
        X %= K


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve(K):
    if K % 2 == 0 or K % 5 == 0:
        print(-1)
        return
    X = 7
    cnt = 1
    while True:
        if X % K == 0:
            print(cnt)
            return
        cnt += 1
        X = X * 10 + 7
        X %= K


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    K = Scanner.int()
    solve(K)


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

N,K = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(1,N):
  dp.append(min(abs(h[i]-h[j])+dp[j] for j in range(max(0,i-K),i)))
print(dp[-1])

### FIXED CODE ###

def main():
    N,K = map(int,input().split())
    h = list(map(int,input().split()))
    dp = [0]*N
    for i in range(1,N):
        dp[i]= min(abs(h[i]-h[j])+dp[j] for j in range(max(0,i-K),i))
    print(dp[-1])
main()
### BUGGY CODE ###

import math
k = int(input())
sum = 0

for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            x = math.gcd(a, b)
            sum += math.gcd(x, c)

print(sum)

### FIXED CODE ###

from math import gcd
k = int(input())
sum = 0

for a in range(1,k+1):
    for b in range(1,k+1): 
        x = gcd(a,b)
        for c in range(1,k+1):
            sum += gcd(x, c)

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

h,w=map(int,input().split())
a,s=[],[]
for i in range(h):
  t=[]
  for j,k in enumerate(input()):
    if k=="#":a.append([i,j])
    t.append(k)
  s.append(t)
for f in range(1,2000):
  b=[]
  for k in a:
    i,j=k[0],k[1]
    if i!=0:
      if s[i-1][j]==".":s[i-1][j]=f;b.append([i-1,j])
    if i!=h-1:
      if s[i+1][j]==".":s[i+1][j]=f;b.append([i+1,j])
    if j!=0:
      if s[i][j-1]==".":s[i][j-1]=f;b.append([i,j-1])
    if j!=w-1:
      if s[i][j+1]==".":s[i][j+1]=f;b.append([i,j+1])
  if b==[]:print(f-1);break
  a=list(b)

### FIXED CODE ###

from collections import deque
import sys
input=sys.stdin.readline
h,w=map(int,input().split())
d=deque()
dc=0
b=[]
for i in range(h):
  t=[]
  s=input()
  for j in range(w):
    if s[j]=="#":d.append((i,j));dc+=1;t.append(1)
    else:t.append(0)
  b.append(t)
count=0
while dc!=0:
  ld=dc
  dc=0
  for i in range(ld):
    x=d.popleft()
    if x[0]<h-1:
      if b[x[0]+1][x[1]]==0:b[x[0]+1][x[1]]=1;d.append((x[0]+1,x[1]));dc+=1
    if 0<x[0]:
      if b[x[0]-1][x[1]]==0:b[x[0]-1][x[1]]=1;d.append((x[0]-1,x[1]));dc+=1
    if x[1]<w-1:
      if b[x[0]][x[1]+1]==0:b[x[0]][x[1]+1]=1;d.append((x[0],x[1]+1));dc+=1
    if 0<x[1]:
      if b[x[0]][x[1]-1]==0:b[x[0]][x[1]-1]=1;d.append((x[0],x[1]-1));dc+=1
  count+=1
print(count-1)
### BUGGY CODE ###

#import copy
def main():
    # x,y = map(int,input().split())           x=1,y=2
    # a = input().split()                      a=['1','2','3',...,'n']
    # a = list(map(int,input().split()))       a=[1,2,3,4,5,...,n]
    # li = input().split('T')	              FFFTFTTFF => li=['FFF', 'F', '', 'FF']
    # 複数行の「1 2 3 4」型の入力を一配列に
    # x = sorted([list(map(int, input().split())) for _ in range(n)])
    # ソート x.sort(key=lambda y:y[1])
    # [chr(i) for i in range(97, 97+26)] 英語小文字リスト
    # [chr(i) for i in range(65, 65+26)] 英語大文字リスト atcoder
    # ord(c) chr(2) alphabet <=> number
    n,q = map(int,input().split()) 
    s=list(input())
    cnt=[0 for _ in range(n+2)]
    for i in range(n-1):
        if ''.join(s[i:i+2])=="AC":
            cnt[i]=1            
    for _ in range(q):
        l,r = map(int,input().split())
        print(sum(cnt[l-1:r-1]))
main()

### FIXED CODE ###

#import copy
def main():
    # x,y = map(int,input().split())           x=1,y=2
    # a = input().split()                      a=['1','2','3',...,'n']
    # a = list(map(int,input().split()))       a=[1,2,3,4,5,...,n]
    # li = input().split('T')	              FFFTFTTFF => li=['FFF', 'F', '', 'FF']
    # 複数行の「1 2 3 4」型の入力を一配列に
    # x = sorted([list(map(int, input().split())) for _ in range(n)])
    # ソート x.sort(key=lambda y:y[1])
    # [chr(i) for i in range(97, 97+26)] 英語小文字リスト
    # [chr(i) for i in range(65, 65+26)] 英語大文字リスト
    # ord(c) chr(2) alphabet <=> number
    n,q = map(int,input().split()) 
    s=input()
    cnt=[0 for _ in range(n+1)]
    for i in range(n):
        cnt[i+1]=cnt[i]+(1 if s[i:i+2]=="AC" else 0)
    for _ in range(q):
        l,r = map(int,input().split())
        print(cnt[r-1]-cnt[l-1])
main()
### BUGGY CODE ###

# -*- coding: utf-8 -*-

def main():
    n = int(input())
    keihin_list = []
    for i in range(n):
        s = input()
        if not s in keihin_list:
            keihin_list.append(s)
    print(len(keihin_list))

if __name__ == "__main__":
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

def main():
    n = int(input())
    keihin_list = []
    for i in range(n):
        s = input()
        keihin_list.append(s)
    print(len(set(keihin_list)))

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

import numpy as np

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

edge = []
for _ in range(N-1):
    edge.append(list(map(int, input().split())))
edge = sorted(edge)
wgt = []
for _ in range(Q):
  wgt.append(list(map(int,input().split())))
#print(edge)

al = {} # adjacency list (dic)
n2w = {} # node to weight
#edge_1d = np.ravel(np.array(edge))
#for i in edge_1d:
for i in range(1,N+1):
  al[i] = []
  n2w[i] = 0 # initialize each node weight
[al[e[0]].append(e[1]) for e in edge]
#print(al)

n2acn = {}# node to all children node

def get_all_children_node(i, ret):
  if len(al[i]) == 0:
    return ret
  elif i in n2acn:
    return (ret + n2acn[i])
  else:
    for ci in al[i]:
      ret.append(ci)
      ret = get_all_children_node(ci, ret=ret)
    return ret

#for i in list(al.keys())[::-1]: # leaf nodeに近いところから計算することで，取得済みのacnを使い回し高速化
for p,_ in wgt[::-1]:
	n2acn[p] = get_all_children_node(p, [])

for p,x in wgt:
  n2w[p] += x
  for i in n2acn[p]:
    n2w[i] += x

ret = ''
for s in n2w.values():
  ret += str(s) + ' '
  
print(ret.strip())



### FIXED CODE ###

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

edge = []
for _ in range(N-1):
    edge.append(list(map(int, input().split())))
edge = sorted(edge)
n2w = [0]*(N+1)
for _ in range(Q):
  tmp = list(map(int,input().split()))
  n2w[tmp[0]] += tmp[1]

for a,b in edge:
  n2w[b] += n2w[a]

print(*n2w[1:])
### BUGGY CODE ###

from collections import deque

H, W = map(int, input().split())
A = [list(input()) for _ in range(H)]

black_idx = []
white_idx = []
for h in range(H):
    for w in range(W):
        if A[h][w] == ".":
            white_idx.append([h,w])
        else:
            black_idx.append([h,w])

distance = [[float("inf")]*W for _ in range(H)]
for b in black_idx:
    distance[b[0]][b[1]] = 0

d = deque(black_idx)
while d:
    y, x = d.popleft()
    for new_y, new_x in ([int(y)+1, int(x)], [int(y), int(x)+1], [int(y)-1, int(x)], [int(y), int(x)-1]):
        if 0 <= new_y <= H-1 and 0 <= new_x <= W-1:
            new_cost = distance[y][x] + 1
            if new_cost < distance[new_y][new_x]: # 距離更新が発生した点だけdequeにappend
                distance[new_y][new_x] = new_cost
                d.append([new_y, new_x])

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, distance[h][w])

print(ans)


### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())
A = [list(input()) for _ in range(H)]

black_idx = []
for h in range(H):
    for w in range(W):
        if A[h][w] == "#":
            black_idx.append([h,w])

distance = [[float("inf")]*W for _ in range(H)]
for b in black_idx:
    distance[b[0]][b[1]] = 0

d = deque(black_idx)
ans = 0

while d:
    y, x = d.popleft()
    for new_y, new_x in ([int(y)+1, int(x)], [int(y), int(x)+1], [int(y)-1, int(x)], [int(y), int(x)-1]):
        if 0 <= new_y <= H-1 and 0 <= new_x <= W-1 and distance[y][x] + 1 < distance[new_y][new_x]:
            distance[new_y][new_x] = distance[y][x] + 1
            ans = max(ans, distance[y][x] + 1)
            d.append([new_y, new_x])

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

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n,k=LI()
  l=LI()

  dp=[inf]*n
  dp[0]=0
  for i in range(n):
    for j in range(1,k+1):
      if i+j<n:
        dp[i+j]=min(dp[i+j],dp[i]+abs(l[i+j]-l[i]))

  return dp[n-1]

print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n,k=LI()
  l=LI()

  dp=[inf]*100010
  dp[0]=0
  for i in range(n):
    for j in range(1,k+1):
      if i+j<n:
        dp[i+j]=min(dp[i+j],dp[i]+abs(l[i+j]-l[i]))

  return dp[n-1]

print(main())
### BUGGY CODE ###



from math import factorial
S=list(map(int,input()))
S.reverse()
count2019 = [0]*2019
count2019[0]=1
mod2019 = 0
d = 1
for i in range(len(S)):
    mod2019 =mod2019+S[i]*d
    mod2019%=2019
    count2019[mod2019] +=1
    d *= 10
    d%2019
ans =0
for i in count2019:
   ans+= i*(i-1)//2
print(ans)
# print(count2019)

### FIXED CODE ###

s = list(input())
# s = list(str(10**200000))
n = len(s)
ans = 0
s.reverse()
# print(s)
x = 1
tot = 0
count = [0]*2019
for i in range(n):
    count[tot]+=1
    tot += int(s[i])*x
    # print(tot)
    tot %= 2019
    ans += count[tot]
    x = x*10%2019
print(ans)
### BUGGY CODE ###

n, m = map(int, input().split())
X = sorted(list(map(int, input().split())))
Diffs = [0] + [X[i] - X[i-1] for i in range(1, m)]
for i in range(n-1):
  m = Diffs.index(max(Diffs))
  Diffs[m] = 0
print(sum(Diffs))


### FIXED CODE ###

n, m = map(int, input().split())
X = sorted(list(map(int, input().split())))
Diffs = [0] + [X[i] - X[i-1] for i in range(1, m)]

if n >= m:
  print(0)
elif n == 1:
  Diffs.sort()
  print(sum(Diffs))
else:
  Diffs.sort()
  print(sum(Diffs[:-(n-1)]))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


N, Q = mi()
S = li()
Alist = []
l = [0] * Q
r = [0] * Q
for i in range(Q):
    l[i], r[i] = mi()
for i in range(N - 1):
    if S[i] == 'A' and S[i + 1] == 'C':
        Alist.append(i)
AClist = [0]*(N+1)
for i in range(N - 1):
    if i in Alist:
        AClist[i + 2] = AClist[i+1] + 1
    else:
        AClist[i+2] = AClist[i+1]

# print(AClist)

for i in range(Q):
    if AClist[l[i] - 1] != AClist[l[i]]:
        print(AClist[r[i]] - AClist[l[i]])
    else:
        print(AClist[r[i]] - AClist[l[i]-1])

### FIXED CODE ###

import sys
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


N, Q = mi()
# print(N, Q)
S = li()
Alist = []
for i in range(N - 1):
    if S[i] == 'A' and S[i + 1] == 'C':
        Alist.append(i)
Aset = set(Alist)
AClist = [0]*(N+1)
for i in range(N-1):
    if i in Aset:
        AClist[i + 2] = AClist[i + 1] + 1
    else:
        AClist[i+2] = AClist[i+1]
        # print(AClist)

for i in range(Q):
    l, r = mi()
    if AClist[l - 1] != AClist[l]:
        print(AClist[r] - AClist[l])
    else:
        print(AClist[r] - AClist[l-1])
### BUGGY CODE ###

from itertools import accumulate
N,M = map(int,input().split())
A = list(map(int,input().split()))
As = [0] + list(accumulate(A))
As = [i%M for i in As]
count = [0 for i in range(M)]
ans = 0
for i in As:
    ans += count[i]
    count[i] += 1
print(ans)

### FIXED CODE ###

from itertools import accumulate
N,M = map(int,input().split())
A = list(map(int,input().split()))
As = [0]
for i in accumulate(A):
    As.append(i%M)
count = {}
ans = 0
for i in As:
    if i not in count:
        count[i] = 1
    else:
        ans += count[i]
        count[i] += 1
print(ans)
### BUGGY CODE ###

def main():
    import sys
    s = str(input())
    t = list(input())
    if set(t) <= set(s):
        t.append('7')
        n = len(s)
        result = 0
        point = 0
        counter = 0
        i = t.pop(0)
        while i != '7':
            if i in s[point:]:
                x = s[point:].index(i)
                result += x + 1
                point += x + 1
                i = t.pop(0)
                counter = 0
            else:
                result += n - point
                point = 0
                counter += 1
        print(result)
    else:
        print(-1)
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    s = str(input())
    t = str(input())
    if set(t) <= set(s):
        x = -1
        counter = 0
        for i in t:
            x = s.find(i, x+1)
            if x == -1:
                counter += 1
                x = s.find(i)
        print(x+1+counter*len(s))
    else:
        print(-1)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

N = int(input())

A = list(map(int, input().split()))
check = []
ans = 0


for i, v in enumerate(A):
    if v in check:
        ans += check.count(v)
    check.append(-v)
    check = list(map(lambda x: x+1, check))

print(ans)
    

### FIXED CODE ###

N = int(input())

A = list(map(int, input().split()))
check = {}
ans = 0


for i, v in enumerate(A):
    if (i-v) in check:
        ans += check[i-v]
    if v+i in check:
        check[v+i] += 1
    else:
        check[v+i] = 1

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

a=int(input())
b=0
c=1
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

for i in range(1,a+1):
    for j in range(1,a+1):
        
        for z in range(1,a+1):
            

            b+=gcd(i,j,z)


print(b)

### FIXED CODE ###

import math
n=int(input())
g=0
for i in range(1,1+n):
    for j in range(1,1+n):
        d=math.gcd(i,j)
        for z in range(1,n+1):
            f=math.gcd(z,d)
            g+=f
print(g)
### BUGGY CODE ###

import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    d = [ [ 2 * 10 ** 3 + 1 for j in range(N) ] for i in range(N) ]
    d = np.array(d)

    d[X-1,Y-1] = 1
    d[Y-1,X-1] = 1

    for i in range(N-1):
        d[i,i+1] = 1
        d[i+1,i] = 1
        d[i,i] = 0

    d[N-1,N-1] = 0

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


    for k in range(1,N):
        res = np.count_nonzero(d == k)
        res //= 2
        print(res)



main()


### FIXED CODE ###

# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    cost = [0 for i in range(N)]

    for i in range(1,N):
        for j in range(i,N+1):
            temp1 = abs(j-i)
            temp2 = abs(X-i) + 1 + abs(j-Y)
            temp3 = abs(Y-i) + 1 + abs(j-X)
            temp = min(temp1,temp2,temp3)
            cost[temp] += 1

    for k in range(1,N):
        print(cost[k])



main()