Harryxun/stf_run huggingface dataset:
#import numpy as np
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm


N = int(input())
#H1,M1,H2,M2,K= map(int,input().split())
#A = list(map(int,input().split()))
#B = list(map(int,input().split()))
#S= str(input())
l=[]
for i in range(N):
    B = int(input())
    l.append(B)

now=0
next=1
c=0
while c<10**6

### FIXED CODE ###

#import numpy as np
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm


N = int(input())
#H1,M1,H2,M2,K= map(int,input().split())
#A = list(map(int,input().split()))
#B = list(map(int,input().split()))
#S= str(input())
l=[]
for i in range(N):
    B = int(input())
    l.append(B)

now=0
next=1
c=0
while c<10**6:
    now=next
    if now==2:
        print(c)
        exit()
    next=l[now-1]
    c+=1

print(-1)
a = input().strip()
if a == 'Sunny':
  print('Cloudy')
else if a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')


### FIXED CODE ###

a = input()
if a == 'Sunny':
  print('Cloudy')
elif a == 'Cloudy':
  print('Rainy')
elif a == 'Rainy':
  print('Sunny')
import sys

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

# 直交座標に直す
if (2 * X - Y) % 3 != 0 or (2 * Y - X) % 3 != 0:
    print(0)
    sys.exit()
x, y = (2 * X - Y) // 3, (2 * Y - X) // 3


def comb_inv(n, k, mod):
    f = [1 for _ in range(n + 1)]
    inv = [1 for _ in range(n + 1)]
    finv = [1 for _ in range(n + 1)]

    for i in range(2, n + 1):
        f[i] = f[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return f[n] * (finv[k] * finv[n - k] % mod) % mod


print(comb_inv(x + y, x, 10 ** 9 + 7))


### FIXED CODE ###

import sys

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

# 直交座標に直す
if X > 2 * Y or Y > 2 * X or \
        (2 * X - Y) % 3 != 0 or (2 * Y - X) % 3 != 0:
    print(0)
    sys.exit()
x, y = (2 * X - Y) // 3, (2 * Y - X) // 3


def comb_inv(n, k, mod):
    f = [1 for _ in range(n + 1)]
    inv = [1 for _ in range(n + 1)]
    finv = [1 for _ in range(n + 1)]

    for i in range(2, n + 1):
        f[i] = f[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return f[n] * (finv[k] * finv[n - k] % mod) % mod


print(comb_inv(x + y, x, 10 ** 9 + 7))
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
mod = int(1e9 + 7)
one_or_two = [0] + [1] + [2] + [-1] * n
for i in range(3, n + 3):
    one_or_two[i] = (one_or_two[i-1] + one_or_two[i-2]) % mod
ans = 1
if a[0] > 1:
    ans *= one_or_two[a[0]-1]
for i in range(1, m):
    if a[i] - a[i-1] == 2:
        continue
    if a[i] - a[i-1] == 1:
        ans = 0
        break
    ans *= one_or_two[a[i] - a[i-1] - 2]
    ans %= mod
if n - a[-1] > 1:
    ans *= one_or_two[n - a[m-1] - 1]
print(ans % mod)

### FIXED CODE ###

n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
mod = int(1e9 + 7)
one_or_two = [0] + [1] + [2] + [-1] * n
for i in range(3, n + 3):
    one_or_two[i] = (one_or_two[i-1] + one_or_two[i-2]) % mod
if m == 0:
    print(one_or_two[n])
    exit()
ans = 1
if a[0] > 1:
    ans *= one_or_two[a[0]-1]
for i in range(1, m):
    if a[i] - a[i-1] == 2:
        continue
    if a[i] - a[i-1] == 1:
        ans = 0
        break
    ans *= one_or_two[a[i] - a[i-1] - 2]
    ans %= mod
if n - a[-1] > 1:
    ans *= one_or_two[n - a[-1] - 1]
print(ans % mod)
# B - Golden Apple

from math import ceil 
N, D = map(int, input().split())
print(ceil(N/(2*D+1)))

### FIXED CODE ###

# A - Dodecagon

r = int(input())
print(3*r**2)
a = int(input().split())
b = int(input().split())
c = int(input().split())
d = int(input().split())
e = int(input().split())
k = int(input().split())
if (e-a)>k:
    print(":(")
else:
    print("Yay!")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if (e-a)>k:
    print(":(")
else:
    print("Yay!")
n = int(input())

A = ()
for i in range (10):
    for j in range(10):
        A.append(i*j)

if A.count(n) != 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = int(input())

A = []
for i in range (10):
    for j in range(10):
        A.append(i*j)

if A.count(n) != 0:
    print("Yes")
else:
    print("No")
A, B = map(int, input().split())
Amin = A//0.08
Amax = A//0.1
Arange = set(range(Amin, Amax))
Bmin = B//0.08
Bmax = B//0.1
Brange = set(range(Bmin, Bmax))
intersection = Arange & Brange
print(min(intersection))

### FIXED CODE ###

A, B = map(int, input().split())
def calc(A, B):
  Amin = A/0.08
  if (Amin - int(Amin)) != 0.:
    Amin = int(Amin)+1
  else:
    Amin = int(Amin)
  Amax = int((A+1)/0.08)
  Arange = set(range(Amin, Amax))
  Bmin = B/0.1
  if (Bmin - int(Bmin)) != 0.:
    Bmin = int(Bmin)+1
  else:
    Bmin = int(Bmin)
  Bmax = int((B+1)/0.1)
  Brange = set(range(Bmin, Bmax))
  intersection = Arange & Brange
  print(-1) if len(intersection) == 0 else print(min(intersection))
calc(A, B)
n=int(input())
ans=0
for i in range(n):
    a,b=input().split()
    if b=='JPY':ans+=int(a)
    else:ans+=int(a)*380000
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(n):
    a,b=input().split()
    if b=='JPY':ans+=int(a)
    else:ans+=float(a)*380000
print(ans)
li = list(input())
for i in range(len(li)):
  if li[i]=="B": li[i-1]==""
else:
  for j in len(li):
    if li[j]=="B": li[j]==""
  else:
    print("".join(li))

### FIXED CODE ###

li = list(input())
ans = ""
for i in li:
  if i == "0":
    ans = ans + "0"
  elif i == "1":
    ans = ans + "1"
  elif i == "B":
    ans = ans[:len(ans)-1]
print(ans)
n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]

print(ac.count("AC"), pen_count)


### FIXED CODE ###

c = input()
a_list= list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, len(a_list)):
    if a_list[i] == c:
        i += 1
        print(a_list[i])
s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
  pos=s.index('T')
  x-=pos
  s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
  l=len(arr[i])
  if l==0:
    continue
  if i%2==0:
    yarr.append(l)
  else:
    xarr.append(l)
if len(xarr)!=0:
  xsum=sum(xarr)
else:
  xsum=0
if len(yarr)!=0:
  ysum=sum(yarr)
else:
  ysum=0
x+=xsum
y+=ysum
if x%2==1 or y%2==1:
  print('No')
else:
  #DP for xarr,yarr
  xdp=[0]*(xsum+5)
  xdp[0]=1
  for val in xarr:
    for i in range(xsum+4,-1,-1):
      if i-val<0:
        break
      if xdp[i-val]==1:
        xdp[i]=1
  ydp=[0]*(ysum+5)
  ydp[0]=1
  for val in yarr:
    for i in range(ysum+4,-1,-1):
      if i-val<0:
        break
      if ydp[i-val]==1:
        ydp[i]=1
  if xdp[x//2]==0:
    print('No')
  else:
    if ydp[y//2]==0:
      print('No')
    else:
      print('Yes')

### FIXED CODE ###

s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
  pos=s.index('T')
  x-=pos
  s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
  l=len(arr[i])
  if l==0:
    continue
  if i%2==0:
    yarr.append(l)
  else:
    xarr.append(l)
x+=sum(xarr)
y+=sum(yarr)
if x%2==1 or y%2==1:
  print('No')
else:
  #DP for xarr,yarr
  xdp=[0]*8005
  xdp[0]=1
  for val in xarr:
    for i in range(8004,-1,-1):
      if i-val<0:
        break
      if xdp[i-val]==1:
        xdp[i]=1
  ydp=[0]*8005
  ydp[0]=1
  for val in yarr:
    for i in range(8004,-1,-1):
      if i-val<0:
        break
      if ydp[i-val]==1:
        ydp[i]=1
  if xdp[x//2]==0:
    print('No')
  else:
    if ydp[y//2]==0:
      print('No')
    else:
      print('Yes')
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
cnt=1
d=0
for i in L:
    d+=L[i]
    if d<=X:
        cnt+=1

print(cnt)

### FIXED CODE ###

N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
cnt=1
d=0
for i in L:
    d+=i
    if d<=X:
        cnt+=1

print(cnt)
a,b=map(int,input().split())
if a==b:
  print('Draw')
elif a==1 or (a>b and B!=1):
  print('Alice')
else:
  print('Bob')

### FIXED CODE ###

a,b=map(int,input().split())
if a==b:
  print('Draw')
elif a==1 or (a>b and b!=1):
  print('Alice')
else:
  print('Bob')
def ra(a): #圧縮された要素を非保持
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append(l)
            l=1
    ll.append(l)
    return ll

n=int(input())
a=list(map(int,input().split()))
b=[1]*(10**6+10)
c=0
d=ra(a)
for i in d:
    if i!=1:
        c-=i
for i in range(n):
    e=a[i]
    for j in range(2,10**6+4):
        b[a[i]*j]=0
        if a[i]*(j+1)>=10**6+5:
            break
for i in range(n):
    c+=b[a[i]]
print(c)

### FIXED CODE ###

n,x=int(input()),10**6+100
a,b,c=list(map(int,input().split())),[0]*(2*x),0
for i in a:
    b[i]+=1
for i in range(x):
    c+=1 if b[i]==1 else 0
    if b[i]==0:
        continue
    for j in range(1,x):
        if i*j>=x:
            break
        b[i*j]=0
print(c)
#!/usr/bin/env python3
# coding: utf-8
import math
# def debug(arg):
#     if __debug__:
#         pass
#     else:
#         import sys
#         print(arg, file=sys.stderr)

def main():
    A, B, H, M = map(int, input().split())

    vh = ((H * 60 + M) / (12 * 60))
    vm = (M / 60)

    theta = (vh - vm) * math.tau
    d = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(theta))

    print(d)

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
# coding: utf-8
def main():
    K = int(input())
    S = input()
    if len(S) <= K:
        print(S)
    else:
        print(S[:K] + '...')

if __name__ == "__main__":
    main()
from math import factorial


def cmb(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)


def p_d():
    N, K = map(int, input().split())
    n = N - K + 1
    mod = 10 ** 9 + 7

    for i in range(1, K + 1):
        c = cmb(n, i)
        k = cmb(K - 1, i - 1)
        print(c * k % mod)


if __name__ == '__main__':
    p_d()


### FIXED CODE ###

from math import factorial


def cmb(n, r):
    return factorial(n) // factorial(r) // factorial(abs(n - r))


def p_d():
    N, K = map(int, input().split())
    n = N - K + 1
    mod = 10 ** 9 + 7

    for i in range(1, K + 1):
        c = cmb(n, i)
        k = cmb(K - 1, i - 1)
        print(c * k % mod)


if __name__ == '__main__':
    p_d()
n, k = map(int, input().split())
d = set(map(int, input().split()))
inf = 10 * n + 1
num = []
for i in range(10):
    if i in d:
        pass
    else:
        num.append(i)

for i in num:
    if i >= int(str(n)[0]):
        ans = i
        break


def dfs(pos, x):
    if pos == len(str(n)):
        if x >= n:
            return x
        else:
            return inf

    ret = [
        dfs(pos + 1, 10 * x + num_i) for num_i in num
    ]

    return min(ret)


print(dfs(1, ans))

### FIXED CODE ###

n, k = map(int, input().split())
d = set(map(int, input().split()))
inf = 10 * n + 1
stop = len(str(n))
num = []
for i in range(10):
    if i in d:
        pass
    else:
        num.append(i)


def dfs(pos, x):
    if pos == stop:
        if x >= n:
            return x
        else:
            return inf

    ret = [
        dfs(pos + 1, 10 * x + num_i) for num_i in num
    ]

    return min(ret)


if dfs(0, 0) != inf:
    print(dfs(0, 0))
else:
    stop += 1
    print(dfs(0, 0))
a,b,c = map(int,input().split())
n = 0
for i in range(min(a,b)):
  if a%i = 0 and b%i =0:
    n += 1
    if n ==c:
      print(i)
      break
    else:
      pass

### FIXED CODE ###

import fractions
a,b,K = map(int,input().split())
g = fractions.gcd(a,b)
cnt = 0
ans = 0
for i in range(g,0,-1):
    if g % i == 0:
        cnt += 1
        if cnt == K:
            ans = i
            break
    else:
        pass
print(ans)
x, a, b = map(int,input().split())
 
if x >= abs(b - a):
  print("safe")
elif x =< abs(b - a):
  print("dangerous")
else:
  print("delicious")


### FIXED CODE ###

x, a, b = map(int,input().split())
 
if 0 >= (b - a):
  print("delicious")
elif x < (b - a):
  print("dangerous")
else:
  print("safe")
N, L = map(int, input().split())
S = [input() for i in range(L)]
s = sorted(S)
print(*s, sep='')

### FIXED CODE ###

N, L = map(int, input().split())
S = [input() for i in range(N)]
s = sorted(S)
print(*s, sep='')
import sys
input = readline
from itertools import product

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

ABCD = [list(map(int, input().split())) for _ in range(q)]

kumiawase = list(product(range(1, m + 1), repeat=n))

ans = 0
for kumi in kumiawase:
    A = [0] + list(kumi)
    temp = 0
    for abcd in ABCD:
        a, b, c, d = abcd
        if A[b] - A[a] == c:
            temp += d
    ans = max(ans, temp)

print(ans)



### FIXED CODE ###

import sys

input = sys.stdin.buffer.readline

from itertools import combinations_with_replacement

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

ABCD = [list(map(int, input().split())) for _ in range(q)]

kumiawase = list(combinations_with_replacement(range(1, m + 1), n))

ans = 0
for kumi in kumiawase:
    A = [0] + list(kumi)
    temp = 0
    for abcd in ABCD:
        a, b, c, d = abcd
        if A[b] - A[a] == c:
            temp += d
    ans = max(ans, temp)

print(ans)
from math import pi
r = int(input())
print("{:.6f} {:.6f}".format(r * r * pi, 2 * r * pi))



### FIXED CODE ###

r = float(input())
print("{:.6f} {:.6f}".format(r * r * 3.14159265359, 2 * r * 3.14159265359))
k = int(raw_input())

print (k*str("ACL"))

### FIXED CODE ###

k = int(input())

print (k*str("ACL"))
S = input()
T = input()
Sli = list(S)
Tli = list(T)
cli = []

for i in range(len(Sli) - len(Tli)):
    c = len(Tli)
    for j in range(len(Tli)):
        if Sli[i + j] == Tli[j]:
            c -= 1
    cli.append(c)

print(min(cli))

### FIXED CODE ###

S = input()
T = input()
Sli = list(S)
Tli = list(T)
cli = []

for i in range(len(Sli) - len(Tli) + 1):
    c = len(Tli)
    for j in range(len(Tli)):
        if Sli[i + j] == Tli[j]:
            c -= 1
    cli.append(c)

print(min(cli))
n,d = map(int,input().split())
a=[]
b=[]
cnt = 0
for i in range(n):
    a[i],b[i] = map(int,input().split())
    if a[i]**2+b[i]**2<=d**2:
        cnt += 1
print("{}".format(cnt))

### FIXED CODE ###

n,d = map(int,input().split())
a=[]
b=[]
cnt = 0
for i in range(n):
    c, e = map(int,input().split())
    if c**2+e**2<=d**2:
        cnt += 1
print("{}".format(cnt))
s = input()
t = input()

s = sorted(s)
t = sorted(t)

# print(s,t)
if s == [] and t == []:
    print('No')
    exit()
elif s == []:
    print('Yes')
elif t == []:
    print('No')
    
if s[0] < t[-1]:
    print('Yes')
    exit()
elif s[0] > t[-1]:
    print('No')
    exit()
elif len(s) < len(x):
    print('Yes')
    exit()
else:
    print('No')


### FIXED CODE ###

s = input()
t = input()

s = sorted(s)
t = sorted(t)

# print(s,t)
if s[0] < t[-1]:
    print('Yes')
    exit()
elif s[0] > t[-1]:
    print('No')
    exit()
elif len(set(s)) ==1 and len(set(t)) ==1 and len(s) < len(t):
    print('Yes')
    exit()
else:
    print('No')
import numpy as np
from numba import njit

@njit
def solve():
    n, k = map(int,input().split())
    l = list(map(int,input().split()))
    
    if k >= 50:
        k = 50
    
    dp= [[0,0]]
    for i in range(n-1):
        dp += [[0]*2]
    
    ans = l[:]
    
    for i in range(k):
        for j in range(n):
            tmp = ans[j]
            dp[j][0] = (j+1 - tmp)
            dp[j][1] = (j+1 + tmp)
    
        ans = [0] * n
    
        for x in range(n):
            for y in range(n):
                if dp[y][0] <= x+1 <= dp[y][1]:
                    ans[x] += 1
    
    else:
        return ans

print(*solve())



### FIXED CODE ###

import numpy as np
from numba import njit

@njit #処理の並列化

def imos(n, a):
    
    l=np.zeros((n+1), dtype = np.int64)

    for i in range(n):
        ai = a[i] # 光の強さ_これにより照らせる範囲が決まる
        start = max(0, i - ai) #StartIndex_照らせる範囲
        end = min(n, i + ai + 1) #EndIndex + 1_照らせる範囲
        l[start] += 1 # 各々を'+1'と'-1'で表し...
        l[end] -= 1
    return np.cumsum(l)[:n] # 累積和をとる_cumulative sum

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

for _ in range(k):
    a = imos(n, a)
    if a.min() == n: # すべての要素が最大値'n'になるとbreak
        break

print(*a)
h, n = map(int, input().split())

dp = [10**7 for i in range(h+100)]
dp[0] = 0
magic = []
for i in range(n):
	a, b = map(int, input().split())
	magic.append([a,b])
	dp[a] = b
#print (dp)


for i in range(h+100):
	for j in range(n):
		if i - magic[j][0] <= 0 or dp[i-magic[j][0]] == 10**7:
			continue
		else:
			dp[i] = min(dp[i],dp[i-magic[j][0]] + magic[j][1])

if dp[h] == 10**7:
	for i in dp[h:]:
		if i != 10**7:
			ans = i
			break
	print (ans)
else:
	print (dp[h])

### FIXED CODE ###

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

inf = 10**9
magic = []
c = 0
for i in range(n):
	a, b = map(int, input().split())
	magic.append([a,b])
	c = max(c,a)

dp = [inf] * (h+c)

for i, j in magic:
	dp[i] = min(dp[i],j)

for i in range(len(dp)):
	for j in range(n):
		if i - magic[j][0] <= 0 or dp[i-magic[j][0]] == inf:
			continue
		else:
			dp[i] = min(dp[i],dp[i-magic[j][0]] + magic[j][1])

print (min(dp[h:]))
N, K=map(int,input().split())
scores=input().split()
for i in range(N):
  scores[i]=int(scores[i])
new=K
old=0
for new<N:
  if scores[new]>scores[old]:
    print("Yes")
  else:
    print("No")
  new+=1
  old+=1

### FIXED CODE ###

N, K=map(int,input().split())
scores=input().split()
for i in range(N):
  scores[i]=int(scores[i])
new=K
old=0
while new<N:
  if scores[new]>scores[old]:
    print("Yes")
  else:
    print("No")
  new+=1
  old+=1
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
for i in range(100):
    if bool(s[i:2]) == False:
        if t[i:2]:
            print("Yes")
            break
        else:
            print("No")
            break
    elif bool(t[i:2]) == False:
        print("No")
        break
    elif (s[i] < t[i]):
        print("Yes")
        break
    elif (s[i] > t[i]):
        print("No")
        break

### FIXED CODE ###

a,b = map(int, input().split())
c = -(-(a + b)//2)
print("{}".format(c))
a,b,c = map(int,input.split())

if a == b:
    print(c)
elif a == c:
    print(b) 
else:
    print(a)
           

### FIXED CODE ###

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

if a == b:
    print(c)
elif a == c:
    print(b) 
else:
    print(a)
n, m = map(int, input().split())
a = list(map(int, input().split()))
from math import gcd

for i in range(n):
    a[i] = a[i]//2
    
# print(a)
def calc(n):
    ret = 0
    while n%2 == 0:
        ret +=1
        n/=2
    return ret


flag = True
t = 0
for i in range(n-1):
    # t = 2**calc(a[i])
    if calc(a[i]) == calc(a[i+1]):
        continue
    else:
        flag = False
        break


gcd_a = 1
for i in range(n):
    p = max(gcd_a, a[i])
    q = min(gcd_a, a[i])
    gcd_a = gcd_a*a[i]//gcd(p, q)
# print("gcd_a", gcd_a)

if flag:
    if (m//gcd_a)%2 == 0:
        print(int((m//gcd_a)//2))
    else:
        print(int((m//gcd_a+1)//2))
else:
    print(0)

### FIXED CODE ###

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

for i in range(n):
    a[i] = a[i]//2
    
# print(a)
def calc(n):
    ret = 0
    while n%2 == 0:
        ret +=1
        n//=2
    return ret


flag = True
t = 0
for i in range(n-1):
    t = 2**calc(a[i])
    if calc(a[i]) == calc(a[i+1]):
        # print(calc(a[i]),calc(a[i+1]))
        continue
    else:
        flag = False
        break


def gcd(a, b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b)



if flag:
    lcm = 1
    for i in range(n):
        p = max(lcm, a[i])
        q = min(lcm, a[i])
        lcm = lcm*a[i]//gcd(p, q)
        # print(lcm)
    if (m//lcm)%2 == 0:
        print(int((m//lcm)//2))
    else:
        print(int((m//lcm+1)//2))

else:
    print(0)
# coding: utf-8
# Your code here!
#途中

N=int(input())

C=[0]*2*10**5

ans=1
pre=-1

#ansの数にも影響を受ける
for _ in range(N):
    c=int(input())
    if pre!=c:
        ans+=C[c]
        C[c]+=1*ans
    pre=c
    print(ans,C[:10])
#print(ans)
    


### FIXED CODE ###

# coding: utf-8
# Your code here!
N=int(input())

l=[0]*2*10**5#ペアを作れるか診断
k=[0]*2*10**5#ansを記録

ans=1
pre=-1
for _ in range(N):
    c=int(input())-1
    if pre==c:
        continue
    l[c]+=1
    ans+=k[c]*min(l[c]-1,1)
    k[c]=ans
    pre=c
    """
    print(c+1)
    print(l[:5],k[:5])
    print(ans)
    """
print(ans%(10**9+7))
S=input()
float(a) = S/60/60
float(b) = a - int(a)
float(c) = b * 60
float(d) = c - int(c)
float(e) = d * 60
print(int(a) + ':' + int(c) + ':' + int(e))

### FIXED CODE ###

t=int(input())
h=t//3600
m=(t%3600)//60
s=t-h*3600-m*60
print('{}:{}:{}'.format(h,m,s))
S=str(input())
ListNum=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUM=(Num-753)**2
    ListNum.append(Num)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))
print(int(int(NUM[posi])**(1/2)))


### FIXED CODE ###

S=str(input())
ListNum=[]
ListNUm=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUm=Num-753
    NUM=NUm**2
    ListNum.append(Num)
    ListNUm.append(NUm)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))

if ListNUm[posi]<0:
  ListNUm[posi]=ListNUm[posi]*(-1)
print(ListNUm[posi])
import numpy as np
import sys
input = sys.stdin.readline


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

    B = np.array([abs(A[i]-X) for i in range(N)])
    print(np.gcd.reduce(B))


if __name__ == '__main__':
    main()

### FIXED CODE ###

from functools import reduce
from fractions import gcd
import sys
input = sys.stdin.readline


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

    B = [abs(A[i]-X) for i in range(N)]
    print(reduce(gcd, B))


if __name__ == '__main__':
    main()
S=input()
ans=700
for i in range(3):
  ans+=100 if S[i]=='o'
print(ans)

### FIXED CODE ###

S=input()
ans=700
for i in range(3):
  if S[i]=='o': ans += 100
print(ans)
import sys
sys.setrecursionlimit(2147483647)
input=sys.stdin.readline

def main():
  n = int(input())
  a = list(map(int, input().split(' ')))
  a.sort()
  a_max = a[-1]
  b = 0
  db = [0] * a_max
  for i in range(1, n-1):
    if a[i] != a[i+1] and a[i] != a[i-1]:
      db[a[i]-1] = 1
  if a[0] != a[1]:
    db[a[0]] = 1
  if n > 1 and a[-1] != a[-2]:
    db[-1] = 1
  for i in a:
    t = 2
    while(i * t <= a_max):
      db[i*t-1] = 0
      t += 1
  print(sum(db))
  

if __name__=='__main__':
  main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
input=sys.stdin.readline

def main():
  n = int(input())
  a = list(map(int, input().split(' ')))
  a.sort()
  a_max = a[-1]
  b = 0
  db = [0] * a_max
  for i in range(1, n-1):
    if a[i] != a[i+1] and a[i] != a[i-1]:
      db[a[i]-1] = 1
  if n == 1 or a[0] != a[1]:
    db[a[0]-1] = 1
  if n > 1 and a[-1] != a[-2]:
    db[-1] = 1
  for i in a:
    t = 2
    while(i * t <= a_max):
      db[i*t-1] = 0
      t += 1
  print(sum(db))
  

if __name__=='__main__':
  main()
s = list(input())
for i in range[3]:
  if(s[i] == s[i+1]):
  	print('Bad')
 	exit()
else:
  print('Good')


### FIXED CODE ###

S = list(input())
for i in range(3):
    if(S[i]==S[i+1]):
        print('Bad')
        exit()
else:
    print('Good')
import functools
import math

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

gcd = functools.reduce(math.gcd, a)
print(gcd)


### FIXED CODE ###

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

def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)

if n==1:
    print(x[0])
else:
    element = gcd(x[0], x[1])
    if n==2:print(element)
    else:
        for i in range(2,n):
            element=gcd(element,x[i])
        print(element)
S = input()
count = 0
if S[0] == 'A':
    S = S[1:]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            S = S[0:i] + S[i+1:]
            if S.islower():
                print('AC')
                break
else:
    print('WA')

### FIXED CODE ###

S = input()
count = 0
if S[0] == 'A' and 'C' in S[2:-1] and S[1:].replace('C','',1).islower():
    print('AC')
else:
    print('WA')