Harryxun/stf_run huggingface dataset:
from operator import mul
from functools import reduce

import sys

sys.setrecursionlimit(20000)

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


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

for i in range(1,k+1):
    print(( cmb(n-k+1,i) * cmb(k-1,i-1) ) % (10**9+7))


### FIXED CODE ###


from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

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

for i in range(1,k+1):
    if n - k + 1 >= i:
        print(( cmb(n-k+1,i) * cmb(k-1,i-1) ) % (10**9+7))
    #青を分けようとするけど赤玉の隙間がたらないとき
    else:
        print(0)
def isPalindrome(str): 
 
    for i in xrange(0, len(str)/2):  
        if str[i] != str[len(str)-i-1]: 
            return False
    return True
  
s = input()
ans = isPalindrome(s) 
  
if (ans): 
    print("Yes") 
else: 
    print("No") 

### FIXED CODE ###

n = input()
x = len(n)

if n == n[::-1]:
    if n[:((x-1)//2)] == n[:((x-1)//2)][::-1]:
        if n[((x+3)//2)-1:] == n[((x+3)//2)-1:][::-1]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
k,x=map(int,input().split())
a=x-k+1
b=x+k-1
a=max(a,-1000000)
b=min(b,1000000)
c=[k for k in range(a,b+1)]
c=' '.join(c)
print(c)


### FIXED CODE ###

k,x=map(int,input().split())
a=x-k+1
b=x+k-1
a=max(a,-1000000)
b=min(b,1000000)
c=[k for k in range(a,b+1)]
for i in c:
  print('%d '%i),
import collections

n=int(input())
v=list(map(int,input().split()))
count=0
vo=[]
ve=[]
for i in range(n):
    if i%2==0:
        ve.append(v[i])
    else:
        vo.append(v[i])
e=collections.Counter(ve)
o=collections.Counter(vo)

emax=e.most_common()[0][0]
emax2=e.most_common()[1][0]
omax=o.most_common()[0][0]
omax2=o.most_common()[1][0]

if emax==omax:
    tempe=0
    tempo=0
    for i in range(n // 2):
        if ve[i] != emax2:
            tempe += 1
    for i in range(n // 2):
        if vo[i] != omax:
            tempe += 1
    for i in range(n // 2):
        if ve[i] != emax:
            tempo += 1
    for i in range(n // 2):
        if vo[i] != omax2:
            tempo += 1
    count=min(tempe,tempo)
else:
    for i in range(n // 2):
        if ve[i] != emax:
            count += 1
    for i in range(n // 2):
        if vo[i] != omax:
            count += 1
    
print(count)



### FIXED CODE ###

import collections

n=int(input())
v=list(map(int,input().split()))
count=0
vo=[]
ve=[]
for i in range(n):
    if i%2==0:
        ve.append(v[i])
    else:
        vo.append(v[i])
e=collections.Counter(ve)
o=collections.Counter(vo)

emax=e.most_common()[0][0]
omax=o.most_common()[0][0]

if emax==omax:
    if e.most_common()[0][1]==len(ve) and o.most_common()[0][1]==len(vo):
        count=n//2
    else:
        omax2 = o.most_common()[1][0]
        emax2 = e.most_common()[1][0]
        tempe = 0
        tempo = 0
        for i in range(n // 2):
            if ve[i] != emax2:
                tempe += 1
        for i in range(n // 2):
            if vo[i] != omax:
                tempe += 1
        for i in range(n // 2):
            if ve[i] != emax:
                tempo += 1
        for i in range(n // 2):
            if vo[i] != omax2:
                tempo += 1
        count = min(tempe, tempo)
else:
    for i in range(n // 2):
        if ve[i] != emax:
            count += 1
    for i in range(n // 2):
        if vo[i] != omax:
            count += 1

print(count)
print()
import numpy as np


DEBUG = True
dprint = print if DEBUG else lambda *x : x

H, N = [int(str) for str in input().strip().split()]
AB = [[int(str) for str in input().strip().split()] for _ in range(N)]

dp = [0]
for h in range(1, H + 1):
    a, b = min(AB, key=lambda i: i[1] + dp[max(0, h - i[0])])
    dp.append(b + dp[max(0, h - a)])    
print(dp[-1])

### FIXED CODE ###

H, N = [int(str) for str in input().strip().split()]
AB = [[int(str) for str in input().strip().split()] for _ in range(N)]

dp = [0]
for h in range(1, H + 1):
    a, b = min(AB, key=lambda i: i[1] + dp[max(0, h - i[0])])
    dp.append(b + dp[max(0, h - a)])    
print(dp[-1])
H, W = map(int, input().split())
S = [input() for _ in range(H)]


def f(i, j):
    t = [[-1] * W for _ in range(W)]
    t[i][j] = 0
    q = [(i, j)]
    while q:
        y, x = q.pop(0)
        if y - 1 >= 0 and S[y - 1][x] != '#' and t[y - 1][x] == -1:
            t[y - 1][x] = t[y][x] + 1
            q.append((y - 1, x))
        if y + 1 < H and S[y + 1][x] != '#' and t[y + 1][x] == -1:
            t[y + 1][x] = t[y][x] + 1
            q.append((y + 1, x))
        if x - 1 >= 0 and S[y][x - 1] != '#' and t[y][x - 1] == -1:
            t[y][x - 1] = t[y][x] + 1
            q.append((y, x - 1))
        if x + 1 < W and S[y][x + 1] != '#' and t[y][x + 1] == -1:
            t[y][x + 1] = t[y][x] + 1
            q.append((y, x - 1))
    return max(max(tt) for tt in t)

result = 0
for i in range(H):
    for j in range(W):
        if S[i][j] != '#':
            result = max(result, f(i, j))
print(result)


### FIXED CODE ###

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


def f(i, j):
    t = [[-1] * W for _ in range(H)]
    t[i][j] = 0
    q = [(i, j)]
    while q:
        y, x = q.pop(0)
        if y - 1 >= 0 and S[y - 1][x] != '#' and t[y - 1][x] == -1:
            t[y - 1][x] = t[y][x] + 1
            q.append((y - 1, x))
        if y + 1 < H and S[y + 1][x] != '#' and t[y + 1][x] == -1:
            t[y + 1][x] = t[y][x] + 1
            q.append((y + 1, x))
        if x - 1 >= 0 and S[y][x - 1] != '#' and t[y][x - 1] == -1:
            t[y][x - 1] = t[y][x] + 1
            q.append((y, x - 1))
        if x + 1 < W and S[y][x + 1] != '#' and t[y][x + 1] == -1:
            t[y][x + 1] = t[y][x] + 1
            q.append((y, x + 1))
    return max(max(tt) for tt in t)


result = 0
for i in range(H):
    for j in range(W):
        if S[i][j] != '#':
            result = max(result, f(i, j))
print(result)
n=int(input())
a=list(map(int,input().split()))
ans=(int)1e10
for i in range(1,101):
  sum=0
  for x in a: sum+=abs(x-i)
  ans=min(ans,sum)
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=1e10
for i in range(1,101):
  sum=0
  for x in a: sum+=pow(abs(x-i),2)
  ans=min(ans,sum)
print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))

mp = dict()
for ix in range(N):
    mp[ix+1] = A[ix]

hist = set()
cur = 1
cnt = 0

while True:
    cur = mp[cur]
    cnt += 1

    if cur in hist:
        break
    else:
        hist.add(cur)

cycle_sp = cur
cycle_l = 0

while True:
    cur = mp[cur]
    cycle_l += 1

    if cur == cycle_sp:
        cycle_l -= 1
        break

rest = (K-cnt) % cycle_l

while rest > 0:
    cur = mp[cur]
    rest -= 1

print(cur)




### FIXED CODE ###

import sys

n, k = map(int, input().split())
ara = [0]
ara += list(map(int, input().split()))

now = 1
vis = []
taken = [0]*(n+1)

while taken[now] == 0:
    vis.append(now)
    taken[now] = 1
    now = ara[now]

cycleLen = len(vis) - vis.index(now)

if k < vis.index(now):
    print(vis[k])
    sys.exit()

k -= vis.index(now)
k %= cycleLen

print(vis[k + vis.index(now)])
import sys
import math

n = int(input())
for s in range(n):
    pos = list(map(float, input().split()))
    if pos[0] == pos[2] or pos[4] == pos[6]:
        angle1 = 0
        angle2 = 0
    else:
        angle1 = (pos[3]-pos[1])/(pos[2]-pos[0])
        angle2 = (pos[7]-pos[5])/(pos[6]-pos[4])
    if abs(angle1 - angle2) <= 1e-10 and angle1 + angle0 != 0:
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

N = input()
 
for n in range(N):
    data = map(float,raw_input().split( ))
    slopes = []
    for i in range(2):
        _x1 = data.pop(0)
        _y1 = data.pop(0)
        _x2 = data.pop(0)
        _y2 = data.pop(0)
         
        if _x1 != _x2:
            slopes.append((_y1 - _y2)/(_x1 - _x2))
     
    if len(slopes) == 0:
        print "YES"
    elif len(slopes) == 1:
        print "NO"
    elif abs(slopes[0] - slopes[1]) < 1e-10:
        print "YES"
    else:
        print "NO"
# -*- coding:utf-8 -*-
import itertools

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

    if len(xs) == 1:
        print(abs(xs[0] - X))
        exit()

    low = 0
    high = 10**9+1
    for x in xs:
        if x < X:
            low = max(x, low)
            continue
        if x > X:
            high = min(x, high)
            continue

    Ds = []
    if low != 0: Ds.append(X - low)
    if high != 10**9+1: Ds.append(high - X)
    for d in Ds:
        failed = False
        for x in xs:
            if abs(X-x)%d == 0:
                continue
            else:
                failed = True
                break
        if failed:
            continue
        else:
            print(d)
            exit()
    print(1)


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

    import math
    from functools import reduce
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    if len(xs) == 1:
        print(abs(xs[0] - X))
        exit()

    diffs = []
    for x in xs:
        diffs.append(abs(x-X))
    print(gcd(*diffs))

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

    import math
    from functools import reduce
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    if len(xs) == 1:
        print(abs(xs[0] - X))
        exit()

    xs.append(X)
    xs.sort()
    diffs = []
    for i in range(len(xs)-1):
        diffs.append(xs[i+1] - xs[i])
    print(gcd(*diffs))


if __name__ == "__main__":
    main3()


### FIXED CODE ###

def main4():
    import fractions
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    diffs = []
    for x in xs:
        diffs.append(abs(X-x))

    if len(diffs) == 1:
        print(diffs[0])
        exit()

    ans = 10**9+1
    for i in range(len(diffs)-1):
        ans = min(fractions.gcd(diffs[i], diffs[i+1]), ans)
    print(ans)

if __name__ == "__main__":
    main4()
wethear = ['Sunny','Cloudy','Rainy']
print(wethear[wethear.index(str(input())) + 1])

### FIXED CODE ###

wethear = ['Sunny','Cloudy','Rainy']
print(wethear[wethear.index(str(input())) - 2])
n = int(input())
a_list = [int(input()) for _ in range(n)]
def calc(start_num, count, max_count, all_list):
    ans = all_list[start_num-1]
    if ans == 2:
        print(count)
    elif count == max_count:
        print('-1')
    else:
        calc(ans, count+1, max_count, all_list)
calc(1, 1, n, a_list)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
n = int(input())
a_list = [int(input()) for _ in range(n)]
def calc_ans(start_num, count, max_count, all_list):
    ans = all_list[start_num-1]
    if ans == 2:
        print(count)
    elif count == max_count:
        print('-1')
    else:
        calc_ans(ans, count+1, max_count, all_list)
calc_ans(1, 1, n, a_list)
def solve(k, n):
    if k & 1 == 0:
        return [k // 2] + [k] * (n - 1)
    xs = [((k ** i - 1) // (k - 1)) for i in range(n + 1, 1, -1)]
    tgt = xs[0] // 2 - 1
    mk = k // 2 + 1
    l = xs[1] * (k // 2)
    for i in range(1, n - 1):
        if l == tgt:
            return [mk] * i
        if l > tgt:
            return [mk] * i + [mk - 1] * (n - i)
        l += xs[i + 1] * (k // 2) + 1
    if l == tgt:
        return [mk] * (n - 1)
    return [mk] * (n - 1) + [tgt - l]


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

print(*solve(k, n))


### FIXED CODE ###

def solve(k, n):
    if k & 1 == 0:
        return [k // 2] + [k] * (n - 1)
    ans = [k // 2 + 1] * n
    l = n
    for i in range((n - 2) // 2 + 1):
        if ans[-1] == 1:
            ans.pop()
            l -= 1
        else:
            ans[-1] -= 1
            if l < n:
                ans += [k] * (n - l)
                l = n
    return ans


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

print(*solve(k, n))
N,T=map(int,input().split())

C=[]

for i in range(N):
    c,t=map(int,input().split())

    if t<=T:
        C.append(c)

print(min(C))


### FIXED CODE ###

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

C=[]

for i in range(N):
    c,t=map(int,input().split())

    if t<=T:
        C.append(c)

if not C:
    print('TLE')
else:
    print(min(C))
import sys
argvs = sys.argv
a=int(argvs[1])
b=int(argvs[2])
print(a*b,a*2+b*2)

### FIXED CODE ###

s = input().split()
a=int(s[0])
b=int(s[1])
print(a*b,a*2+b*2)
import numpy as np
N, W = map(int, input().split())

dp=np.zeros((N+1, W+1), dtype=np.int64)

for i in range(1, N+1):
	w, v = list(map(int, input().split()))
	dp[i]=dp[i-1]
	dp[i][w:]=np.maximum(dp[i-1][:W-w+1]+v, dp[i-1][w:])
print(np.max(dp))

### FIXED CODE ###

N, W = map(int, input().split())
w=[]
v=[]
for i in range(N):
	a, b = map(int, input().split())
	w.append(a)
	v.append(b)
#dp[i+1][j] := i番目までの品物から総和がjとなるように選んだ時の重さの総和の最小値
dp=[[float("inf")]*(max(v)*N+1) for _ in range(N+1)]
#初期条件
dp[0][0]=0
for i in range(N):
	for j in range(max(v)*N+1):
		if v[i]>j:
			dp[i+1][j] = dp[i][j]
		else:
			dp[i+1][j] = min(dp[i][j], dp[i][j-v[i]]+w[i])

ans=0
for j in range(max(v)*N+1):
	if dp[N][j]<=W:
		ans=j
print(ans)
K,X = input().split()

def main(K,X):
  if K * 500 >= X:
    print('Yes')
  else:
    print('No')
 
if __name__ == '__main__':
  main()


### FIXED CODE ###

K,X = input().split()

def main(K,X):
  K = int(K)
  X = int(X)
  if K * 500 >= X:
    print('Yes')
  else:
    print('No')
 
if __name__ == '__main__':
  main(K,X)
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = a % 10
B = b % 10
C = c % 10
D = d % 10
E = e % 10
L = list[A,B,C,D,E]
min_ = L.index(min(L)
A = math.ceil(a)
B = math.ceil(b)
C = math.ceil(c)
D = math.ceil(d)
E = math.ceil(e)
m = A+B+C+D+E
if min_ == 0:
  m = m - A + a
elif min_ == 1:
  m = m - B + b
elif min_ == 2:
  m = m - C + c
elif min_ == 3:
  m = m - D + d
elif min_ == 4:
  m = m - E + e
print(m)

               

### FIXED CODE ###

import math
 
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = a % 10
B = b % 10
C = c % 10
D = d % 10
E = e % 10
L = [A,B,C,D,E]
L = [10 if i == 0 else i for i in L]
min_ = L.index(min(L))
A = math.ceil(a*0.1)*10
B = math.ceil(b*0.1)*10
C = math.ceil(c*0.1)*10
D = math.ceil(d*0.1)*10
E = math.ceil(e*0.1)*10
m = A+B+C+D+E
if min_ == 0:
  m = m - A + a
elif min_ == 1:
  m = m - B + b
elif min_ == 2:
  m = m - C + c
elif min_ == 3:
  m = m - D + d
elif min_ == 4:
  m = m - E + e
print(m)
import math
def main():
    def get_inputs():
        input_list = []
        try:
            while True:
                input_list.append(input())
        except EOFError:
            return input_list

    input_list = get_inputs()
    lcm = lambda a,b: a*b / math.gcd(a,b)
    for str_num in input_list:
        tmp = str_num.split(" ")
        a,b = int(tmp[0]),int(tmp[1])
        x = math.gcd(a,b)
        y = int(lcm(a,b))
        print("{} {}".format(x,y))
    return None


if __name__ == '__main__':
    main()

### FIXED CODE ###

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

def lcm(a, b):
    return (a * b) // gcd(a,b)


while True:
    try:
        a, b = [int(i) for i in input().split()]
        print(gcd(a, b), lcm(a, b))
    except EOFError:
        break
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,1,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])

### FIXED CODE ###

a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,0,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])
import numpy as np

def how_many_times_divisibles(j):
	counter=0
	while j%2==0:
		j/=2
		counter+=1
	return counter

n=int(input())
a=map(int,input().split())
ans=min(map(how_many_times_divisibles,a))
print(ans)

### FIXED CODE ###

s=input()
counter=0

for n in range(3):
  if int(s[n])==1:
    counter+=1

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

### FIXED CODE ###

n = int(input())
b = list(map(int, input().split()))
a = b[0] + b[n-2]
if n > 2:
    for i in range(0,n-2):
        a = a + min(b[i],b[i+1])
print(a)
import collections
n = int(input())
v = list(map(int, input().split()))
even = []
even_c = 0
odd = []
odd_c = 0
ans = 0
for i in range(n):
    if i % 2 == 0:
        even.append(v[i])
        even_c += 1
    else:
        odd.append(v[i])
        odd_c += 1
even  = collections.Counter(even)
odd = collections.Counter(odd)
even_max = max(list(even.items()), key = lambda x: x[1])
odd_max = max(list(odd.items()), key = lambda x: x[1])
if even_max[0] == odd_max[0]:
    even_sec = [i for i in list(even.items()) if i[0] != even_max[0]] 
    odd_sec = [i for i in list(odd.items()) if i[0] != odd_max[0]]
    if len(even_sec) == 0 and len(odd_sec) == 0:
        print(min(even_max[1], odd_max[1]))
        exit()
    if len(even_sec) == 0:
        ans += min(even_max[1], odd_c - odd_max[1])
        print(ans)
        exit()
    if len(odd_sec) == 0:
        ans += min(odd_max[1], even_c - even_max[1])
        print(ans)
        exit()
    even_sec = max(even_sec, key = lambda x: x[1])
    odd_sec = max(odd, key = lambda x: x[1])
    if even_max[1] > odd_max[1]:
        ans += even_c - even_max[1]
        ans += odd_c - odd_sec[1]
    elif even_max[1] < odd_max[1]:
        ans += odd_c - odd_max[1]
        ans += even_c - even_sec[1]
    else:
        if odd_sec[1] < even_sec[1]:
            ans += even_c - even_sec[1]
            ans += odd_c - odd_max[1]
        elif odd_sec[1] > even_sec[1]:
            ans += odd_c - odd_sec[1]
            ans += even_c - even_max[1]
        else:
            ans += even_c - even_max[1]
            ans += odd_c - odd_sec[1]
else:
    ans += even_c - even_max[1]
    ans += odd_c - odd_max[1]
print(ans)


### FIXED CODE ###

import collections
n = int(input())
v = list(map(int, input().split()))
even = []
odd = []
for i in range(n):
    if i % 2 == 0:
        even += [v[i]]
    else:
        odd += [v[i]]
even_dict = collections.Counter(even)
odd_dict = collections.Counter(odd)
max_even = max(even_dict.items(), key = lambda x:x[1])
max_odd = max(odd_dict.items(), key = lambda x:x[1])
#最高の値が同じでない
if max_even[0] != max_odd[0]:
    print(len(even) - max_even[1] + len(odd) - max_odd[1])
else:
    #同じだった場合
    if max_even[1] == len(even) and max_odd[1] == len(odd):
        second_even = (-1,0)
        second_odd = (-1,0)
    elif max_even[1] == len(even):
        second_even = (-1,0)
        second_odd = max([i for i in odd_dict.items() if i != max_odd], key = lambda x:x[1])
    elif max_odd[1] == len(odd):
        second_even = max([i for i in even_dict.items() if i != max_even], key = lambda x:x[1])
        second_odd = (-1,0)
    else:
        second_even = max([i for i in even_dict.items() if i != max_even], key = lambda x:x[1])
        second_odd = max([i for i in odd_dict.items() if i != max_odd], key = lambda x:x[1])
    #二つ目に大きいやつも同じかどうか
    if second_even[1] > second_odd[1]:
        print(len(even) - second_even[1] + len(odd) - max_odd[1])
    else:
        print(len(even) - max_even[1] + len(odd) - second_odd[1])
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
S=one_str()

bit_count = S.count("1")

#bit数
calc_dict = {i:-1 for i in range(22000)}
res_dict =  {i:-1 for i in range(2*(10**5))}

res_dict = {i:-1 for i in range(1001)}
res_dict[0]=0

for i in range(1, 1001):
    if calc_dict[i]==-1:
        calc_dict[i] = bin(i).count("1")
    
    res_dict[i] = i%calc_dict[i]+1




# def mods(N, m, count):
#     temp = N%m
#     count+=1
#     while temp!=0:

#         if temp in res_dict:
# #             print(count, temp, res_dict[temp])
# #             print("come")
# #             print()
#             return count+res_dict[temp]
        
#         if calc_dict[temp]==-1:
#             calc_dict[temp] = bin(temp).count("1")
            
#         temp = temp%calc_dict[temp]
#         count+=1

#     return count

bit_count = S.count("1")
for i in range(len(S)):
    if S[i]=="0":

        bit_count+=1
        num = int(S,2) + 2**(N-i-1)
#         print(num, bit_count)
        print(res_dict[num%bit_count]+1)
#         print(mods(num, bit_count, 0))
        bit_count-=1
    else:

        bit_count-=1
        num = int(S,2) - 2**(N-i-1)
        print(res_dict[num%bit_count]+1)
#         print(mods(num, bit_count, 0))
        bit_count+=1

### FIXED CODE ###

def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
S=one_str()

bit_count = S.count("1")
S_num = int(S,2)
S_min = S_num % (bit_count-1) if bit_count-1!=0 else 0
S_plu = S_num % (bit_count+1)




# calc_dict = {i:-1 for i in range(10000)}
# res_dict =  {i:-1 for i in range(10**4)}

# for i in range(1, 10000):
#     if calc_dict[i]==-1:
#         calc_dict[i] = bin(i).count("1")

#     res_dict[i] = i%calc_dict[i]+1

def mods(temp, count):
    count+=1
    if temp!=0:

#         if temp in res_dict:
#             return count+res_dict[temp]
        
#         if temp not in calc_dict:
#             calc_dict[temp]= bin(temp).count("1") 
        count = mods(temp%bin(temp).count("1") , count)

    return count

for i in range(N):
    if S[i]=="0":
        part = pow(2, (N-i-1), bit_count+1)
        num = (S_plu + part ) % (bit_count+1)
        print(mods(num, 0))
    else:
        if S_num == 2**(N-i-1):
            print(0)
            continue
        part = pow(2, (N-i-1), bit_count-1)
        num = (S_min - part)%(bit_count-1)
        print(mods(num, 0))
# 2つの整数の取得
a,b = map(int,input().split())

# aもしくはbが偶数であるかをもとに結果を出力
if a % 2 = 0 or b % 2 = 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

# 2つの整数の取得
a,b = map(int,input().split())
 
# aもしくはbが偶数であるかをもとに結果を出力
if (a % 2) == 0 or (b % 2) == 0:
    print("Even")
else:
    print("Odd")
input(a, b)
if (a*b)%2 == 1:
  print("Odd")
else:
  print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b)%2 == 1:
  print("Odd")
else:
  print("Even")
n,k = map(int,input().split())
s input()
s[k-1] = s[k-1].lower()
print(s)

### FIXED CODE ###

n,k = map(int,input().split())
s = input()
print(s[:k -1] + s[k -1].lower() + s[k:])
n,x,m = map(int, input().split())
b = x%m
add = 0

# nがm以下なら全部足せば良い
ans = 0
if n <= m:
    for i in range(n):
        ans += b    
        b = pow(b,2,m)
    print(ans)
    exit()

# nがmより大のとき、効率化
cnt = 0
while 2 ** cnt < m:
    cnt += 1

# 位数と初期値を出す
s = set()
for i in range(m):
    if i < cnt:
        add += b
        tmp = b
    else:
        s.add(b)
    b = pow(b, 2, m)
# cnt以降、和*位数+残りの和で計算
rest = (n-cnt)%len(s)
div = (n-cnt)//len(s)

rep = []
for i in range(len(s)):
    tmp = pow(tmp, 2, m)
    rep.append(tmp)

print(len(s),len(rep))
ans = add + sum(rep)*div + sum(rep[:rest])
print(ans)

### FIXED CODE ###

n,x,m = map(int, input().split())
b = x%m
add = 0

# nがm以下なら全部足せば良い
ans = 0
if n <= m:
    for i in range(n):
        ans += b    
        b = pow(b,2,m)
    print(ans)
    exit()

# nがmより大のとき、効率化
cnt = 0
while 2 ** cnt < m:
    cnt += 1

# 位数と初期値を出す
s = set()
tmp = 0
for i in range(m):
    if i < cnt:
        add += b
        tmp = b
    else:
        s.add(b)
    b = pow(b, 2, m)

# cnt以降、和*位数+残りの和で計算
rest = (n-cnt)%len(s)
div = (n-cnt)//len(s)

rep = []
for i in range(len(s)):
    tmp = pow(tmp, 2, m)
    rep.append(tmp)

ans = add + sum(rep)*div + sum(rep[:rest])
print(ans)
a, b, c = map(int, input().split())
r = 'YES' if b - a == c - b else 'N

### FIXED CODE ###

a, b, c = map(int, input().split())
r = 'YES' if b - a == c - b else 'NO'
print(r)