Harryxun/stf_run huggingface dataset:
import sys
from collections import Counter
from itertools import accumulate

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

    AC = accumulate([0] + A, func=lambda x,y:(x+y)%M)
    ACC = Counter(AC)

    ans = 0
    for c in ACC.values():
        ans += c * (c-1) // 2
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import Counter
from itertools import accumulate

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

    AC = accumulate([0] + A, func=lambda x,y:(x+y)%M)
    ACC = Counter(AC)

    ans = 0
    for c in ACC.values():
        ans += c * (c-1) // 2
    print(ans)

if __name__ == '__main__':
    main()
N,K=input().split()
N=int(N)
K=int(K)
a=[]
a=[int(a) for a in input().split()]
a.sort()
print(sum(a[0:K-1])

### FIXED CODE ###

N,K=input().split()
N=int(N)
K=int(K)
a=[]
a=[int(a) for a in input().split()]
a.sort()
print(sum(a[0:K]))
# -*- coding: utf-8 -*-
N = input()
print (N/3)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
print (int(N/3))
import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W-A):
        mat[y][x]=1

for y in range(B,H-B+1):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))

### FIXED CODE ###

import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W):
        mat[y][x]=1

for y in range(B,H):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j] == b[k]:
                a[i][j] = 0

ans = "No"
for i in range(3):
    if a[i][0] + a[i][1] + a[i][2] == 0:
        ans = "Yes"
    if a[0][i] + a[1][i] + a[2][i] == 0:
        ans = "Yes"
if a[0][0] == a[1][1] == a[2][2] == 0 or a[0][2] == a[1][1] == a[2][0] == 0:
    ans = "Yes
print(ans)

### FIXED CODE ###

a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j] == b[k]:
                a[i][j] = 0

ans = "No"
for i in range(3):
    if a[i][0] + a[i][1] + a[i][2] == 0:
        ans = "Yes"
    if a[0][i] + a[1][i] + a[2][i] == 0:
        ans = "Yes"
if a[0][0] + a[1][1] + a[2][2] == 0:
    ans = "Yes"
if a[0][2] + a[1][1] + a[2][0] == 0:
    ans = "Yes"
print(ans)
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    from collections import Counter
    n = input_int()
    A = input_int_list()
    A_cnt = Counter(A).most_common()
    A_cnt = [list(a) for a in A_cnt]
    cnt = 0
    for i in range(len(A_cnt)):
        if A_cnt[i][1] > 2:
            if A_cnt[i][1] % 2 == 1:
                cnt += A_cnt[i][1] // 2
                A_cnt[i][1] = 1
            elif A_cnt[i][1] % 2 == 0:
                cnt += (A_cnt[i][1] // 2) - 1
                A_cnt[i][1] = 2
        if A_cnt[i][1] == 2:
            A_cnt[i + 1][1] -= 1
            A_cnt[i][1] = 1
            cnt += 1
    print(n - cnt * 2)
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    from collections import Counter
    n = input_int()
    A = input_int_list()
    A_cnt = Counter(A).most_common()
    A_cnt = [list(a) for a in A_cnt]
    cnt = 0
    for i in range(len(A_cnt)):
        if A_cnt[i][1] > 2:
            if A_cnt[i][1] % 2 == 1:
                cnt += A_cnt[i][1] // 2
                A_cnt[i][1] = 1
            elif A_cnt[i][1] % 2 == 0:
                cnt += (A_cnt[i][1] // 2) - 1
                A_cnt[i][1] = 2
        if A_cnt[i][1] == 2:
            if i + 1 < len(A_cnt):
                A_cnt[i + 1][1] -= 1
            A_cnt[i][1] = 1
            cnt += 1
    print(n - cnt * 2)
    return


if __name__ == "__main__":
    main()
x, a, b = map(int, input().split())
print('delicious' if a >= b else 'safe' x >= b-a else 'dangerous')

### FIXED CODE ###

x, a, b = map(int, input().split())
print('delicious' if a >= b else 'safe' if x >= b-a else 'dangerous')
list = map(int,raw_input().split())
W = list[0] 
H = list[1] 
x = list[2]
y = list[3]
r = list[4]

if x-r < 0:
    print "No"
elif x + r > W:
    print "No"
elif y-r < 0:
    print "No"
elif y+r > H:
    print "No"
else:
    print "Yes"

### FIXED CODE ###

W,H,x,y,r = map(int,input().split(" "))
if x - r >= 0 and x + r <= W:
    if y - r >= 0 and y + r <= H:
        print("Yes")
    else:
        print("No")
else:
    print("No")
# -*- coding: utf-8 -*-
n = int(input())

res = 0
for _ in range(n):
    x,u = input().split()
    if u=="JPY":
        res += int(x)
    else:
        res += float(x)*380000.0

print("{:.8}".format(res))


### FIXED CODE ###

# -*- coding: utf-8 -*-
from decimal import *
n = int(input())

res1 = Decimal(0)
res2 = Decimal(0)
for _ in range(n):
    x,u = input().split()
    if u=="JPY":
        res1 += Decimal(x)
    else:
        res2 += Decimal(x)*Decimal(380000.0)

print(res1+res2)
a,b=map(int,input().split())
if a%2==b%2:
  return ((a+b)/2)
else:
  print("IMPOSSIBLE")


### FIXED CODE ###

a,b=map(int,input().split())
if a%2==b%2:
  print (int((a+b)/2))
else:
  print("IMPOSSIBLE")
#AGC030 B - Powers of two
beki=[]
for i in range(1,32):
    beki.append(2**i)#bekiは２のべき乗の配列
N=int(input())
A=input().split()
for i in range(N):
    A[i]=int(A[i])
sorted(A)#Aを昇順にソート
for i in (reversed(beki)):
    B=A
    for j in B:
        if j==i/2 and B.count(j)=>2:
            A.remove(j)
            A.remove(j)
        if i-j in A:
            A.remove(j)
            A.remove(i-j)
print((N-len(A))//2)

### FIXED CODE ###

#AGC030 B - Powers of two
import collections
import math
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
cnter=collections.Counter(A)
ans=0
for a in A:
    inv=2**(int(math.log2(a))+1)
    if cnter[a]==0:
        continue
    if inv==2*a and cnter[inv-a]<=1:
      	continue
    if cnter[inv-a]>0:
        cnter[inv-a]=cnter[inv-a]-1
        cnter[a]=cnter[a]-1
        ans=ans+1
print(ans)
import collections
H, W = map(int, input().split())
S = [input() for _ in range(H)]
brack_point = []
for i in range(H):
    for k in range(W):
        if S[i][k] == '#':
            brack_point.append([i,k])
def f(sx, sy, gx, gy):
    q = collections.deque()
    q.append((sx, sy))
    dist = [[float("inf") for w in range(H)] for h in range(W)]
    dist[sx][sy] = 0
    dx = [(-1, 0), (1, 0), (0, -1), (0, 1)]
    while len(q) != 0:
        h, w = q.popleft()
        d = dist[h][w]
        for x, y in dx:
            h2 = h + y
            w2 = w + x
            if h2 >= 0 and h2 < W and w2 >= 0 and w2 < H:
                if S[h2][w2] == "." and dist[h2][w2] == float("inf"):
                    dist[h2][w2] = d+1
                    q.append((h2, w2))
    return dist[gy][gx]
ans = 0
for i in range(H):
    for k in range(W):
        if S[i][k] == '.':
            tmp = float('inf')
            for point in brack_point:
                tmp = min(tmp,f(point[0],point[1],i,k))
            ans = max(ans,tmp)
print(ans)

### FIXED CODE ###

import collections
H, W = map(int, input().split())
S = [input() for _ in range(H)]
def f():
    q = collections.deque()
    dist = [[float("inf")] * W for _ in range(H)]
    for i in range(H):
        for k in range(W):
            if S[i][k] == '#':
                q.append((i,k))
                dist[i][k] = 0
    dx = [(-1, 0), (1, 0), (0, -1), (0, 1)]
    while len(q) != 0:
        h, w = q.popleft()
        d = dist[h][w]
        for x, y in dx:
            h2 = h + y
            w2 = w + x
            if h2 >= 0 and h2 < H and w2 >= 0 and w2 < W:
                if dist[h2][w2] == float("inf"):
                    dist[h2][w2] = d+1
                    q.append((h2, w2))
    return dist
ans = 0
dist = f()
for i in range(H):
    for k in range(W):
        ans = max(ans,dist[i][k])
print(ans)
def gcd(n, m):
    if min(n, m) == 0:
        return max(n,m)
    else:
        return gcd(min(n,m), max(n,m) % min(n,m))

def lcm(n, m):
    return int(n * m / gcd(n, m))


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(int(time), t_sorted[i])

print(int(time))

### FIXED CODE ###

def gcd(n, m):
    if min(n, m) == 0:
        return max(n,m)
    else:
        return gcd(min(n,m), max(n,m) % min(n,m))

def lcm(n, m):
    return n * m // gcd(n, m)


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(time, t_sorted[i])

print(int(time))
#import numpy as np

def FindMaxCon(res, water, C, D, E):
  c = 0
  d = 0
  tmpCon = 0
  dp = list([False] * 3001)
  dp[0] = True
  for i in range(3001):
    if(i - C >= 0 and i - D >= 0):
      dp[i] = dp[i - C] or dp[i - D]
    elif(i - C >= 0):
      dp[i] = dp[i - C]
    elif(i - D >= 0):
      dp[i] = dp[i - D]
  tmpSugar = 0
  for i in range(min(res, E * water / 100) + 1):
    if(dp[i]):
      tmpSugar = i
  ans = tmpSugar
  return ans

A, B, C, D, E, F = (map(int, input().split()))
amax = F / (A * 100)
bmax = F / (B * 100)
amax = int(amax)
bmax = int(bmax)
water = 0
sugar = 0
waterAns= 0
sugarAns = 0
con = 0
conAns = 0
for a in range(1, amax + 1):
  for b in range(bmax + 1):
    water = 100 * (a * A + b * B)
    if(water > F):
      continue
    else:
      res = F - water
      tmp = FindMaxCon(res, water, C, D, E)
      sugar = tmp
      con = sugar / water
      if(con > conAns):
        conAns = con
        waterAns = water
        sugarAns = sugar
answer = str(waterAns + sugarAns) + " " + str(sugarAns)
print(answer)

### FIXED CODE ###

#import numpy as np

def FindMaxCon(res, water, C, D, E):
  c = 0
  d = 0
  tmpCon = 0
  dp = list([False] * 3001)
  dp[0] = True
  for i in range(3001):
    if(i - C >= 0 and i - D >= 0):
      dp[i] = dp[i - C] or dp[i - D]
    elif(i - C >= 0):
      dp[i] = dp[i - C]
    elif(i - D >= 0):
      dp[i] = dp[i - D]
  tmpSugar = 0
  for i in range(min(res, int(E * water / 100)) + 1):
    if(dp[i]):
      tmpSugar = i
  ans = tmpSugar
  return ans

A, B, C, D, E, F = (int(_) for _ in input().split())
amax = F / (A * 100)
bmax = F / (B * 100)
amax = int(amax)
bmax = int(bmax)
water = 0
sugar = 0
waterAns = 100 * A
sugarAns = 0
con = 0
conAns = 0
for a in range(1, amax + 1):
  for b in range(bmax + 1):
    water = 100 * (a * A + b * B)
    if(water > F):
      continue
    else:
      res = F - water
      tmp = FindMaxCon(res, water, C, D, E)
      sugar = tmp
      con = sugar / water
      if(con > conAns):
        conAns = con
        waterAns = water
        sugarAns = sugar
answer = str(waterAns + sugarAns) + " " + str(sugarAns)
print(answer)
import sys
input = sys.stdin.readline

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

mod=10**9+7
# mod の逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

# 正,負 で分ける
b=[]
c=[]
for i in a:
    if i>=0:
        b.append(i)
    else:
        c.append(i)

b.sort(reverse=True)
c.sort()
ans=1
if k==n and len(c)%2==0:
    for i in range(n):
        ans*=a[i]
        ans%=mod

elif k%2==1 and len(c)==n:
    c.sort(reverse=True)
    for i in range(k):
        ans*=c[i]
        ans%=mod

else:
    x=k
    # プラスの配列をどこまで進めたか
    v=0
    # マイナスの配列をどこまで進めたか？
    w=0
    for i in range(k):
        if x>=2:
            x-=2
            if v+2<=len(b) and w+2<=len(c):
                if b[v]*b[v+1]>c[w]*c[w+1]:
                    ans*=b[v]*b[v+1]
                    v+=2
                else:
                    ans*=c[w]*c[w+1]
                    w+=2


            elif v+2<=len(b):
                ans*=b[v]*b[v+1]
                v+=2

            else:
                ans*=c[w]*c[w+1]
                w+=2
            ans%=mod
            if x==0:
                break
        else:
            ans*=b[v]
            ans%=mod
            break
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

mod=10**9+7
# mod の逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

# 正,負 で分ける
b=[]
c=[]
for i in a:
    if i>=0:
        b.append(i)
    else:
        c.append(i)

b.sort(reverse=True)
c.sort()
ans=1
if k==n:
    for i in range(n):
        ans*=a[i]
        ans%=mod

elif k%2==1 and len(c)==n:
    c.sort(reverse=True)
    for i in range(k):
        ans*=c[i]
        ans%=mod

else:
    x=k
    # プラスの配列をどこまで進めたか
    v=0
    # マイナスの配列をどこまで進めたか？
    w=0
    if k%2==1:
        ans*=b.pop(0)
        k-=1

    for i in range(k):
        if x>=2:
            x-=2
            if v+2<=len(b) and w+2<=len(c):
                if b[v]*b[v+1]>c[w]*c[w+1]:
                    ans*=b[v]*b[v+1]
                    v+=2
                else:
                    ans*=c[w]*c[w+1]
                    w+=2


            elif v+2<=len(b):
                ans*=b[v]*b[v+1]
                v+=2

            else:
                ans*=c[w]*c[w+1]
                w+=2

            ans%=mod
            if x==0:
                break

print(ans)
# coding = utf-8
list1 = []
list2 = []

time = 0
for n in range(5):

    list1.append(int(input()))

for n in list1:
    q = n // 10
    mod = n % 10
    time += 10 * q
    if mod != 0:
        time += 10
        list2.append(mod)

time = time -10 + min(list2)
print int(time)


### FIXED CODE ###

list1 = []
list2 = []

time = 0
for n in range(5):

    list1.append(int(input()))

for n in list1:
    q = n // 10
    mod = n % 10
    time += 10 * q
    if mod != 0:
        time += 10
        list2.append(mod)


if list2 != []:
    time = time - 10 + min(list2)
    print int(time)
else:
    print int(time)
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import *

import numpy as np

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N = read()
A = sorted(reads())
B = sorted(reads())
C = sorted(reads())

numB = [0] * N
for i in range(N):
  numB[i] = N - bisect_left(C, B[i]+1)
print(numB, file=stderr)

anumB = [0] * (N+1)
for i in range(N):
  anumB[i+1] = anumB[i] + numB[i]
print(anumB, file=stderr)

numA = [0] * N
for i in range(N):
  numA[i] = anumB[N] - anumB[bisect_left(B, A[i]+1)]
print(numA, file=stderr)

print(sum(numA))

### FIXED CODE ###

from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import *

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N = read()
A = sorted(reads())
B = sorted(reads())
C = sorted(reads())

numB = [0] * N
for i in range(N):
  numB[i] = N - bisect_left(C, B[i]+1)
print(numB, file=stderr)

anumB = [0] * (N+1)
for i in range(N):
  anumB[i+1] = anumB[i] + numB[i]
print(anumB, file=stderr)

numA = [0] * N
for i in range(N):
  numA[i] = anumB[N] - anumB[bisect_left(B, A[i]+1)]
print(numA, file=stderr)

print(sum(numA))
n=int(input())

m=int(input())


if n==m:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

r = input()
k=r.split()
if k[0] == k[1]:
    print('Yes')
else:
    print('No')
X, N = map(int, (input().split(' ')))
    if N > 0:
        P = sorted(map(int, input().split(' ')))
        P_max = max(P)
        P_min = min(P)
        if X in P:
            for i in range(1, max(P_max-X + 1 , X-P_min +1)):
                if (X-i) not in P:
                    print(X-i)
                    break

                elif (X+i) not in P:
                    print(X+i)
                    break
        elif X not in P:
            print(X)
        else:
            print(" ")
    else:
        print(" ")



### FIXED CODE ###

if __name__=="__main__":
    # Problem C
    X, N = map(int, (input().split(' ')))
    if N > 0:
        P = sorted(map(int, input().split(' ')))
        P_max = max(P)
        P_min = min(P)
        if X in P:
            for i in range(100):
                if (X-i) not in P:
                    print(X-i)
                    break

                elif (X+i) not in P:
                    print(X+i)
                    break
        elif X not in P:
            print(X)
    else:
        print(X)
n-int(input())
arr1=list(map(int,input().split()))
arr1=sorted(arr1)
m=int(input())
arr2=list(map(int,input().split()))
arr2=sorted(arr2)
pos=0
for i in range(n):
  if arr1[i]==arr2[pos]:
    pos+=1
  if pos==m:
    print('YES')
    break
else:
  print('NO')

### FIXED CODE ###

n=int(input())
arr1=list(map(int,input().split()))
arr1=sorted(arr1)
m=int(input())
arr2=list(map(int,input().split()))
arr2=sorted(arr2)
pos=0
for i in range(n):
  if arr1[i]==arr2[pos]:
    pos+=1
  if pos==m:
    print('YES')
    break
else:
  print('NO')
l =  ['SUN','MON','TUE','WED','THU','FRI','SAT']
S = str(input())

print(int(7 - S.index()))l =  ['SUN','MON','TUE','WED','THU','FRI','SAT']
S = str(input())

print(int(7 - l.index(S)))

### FIXED CODE ###

l =  ['SUN','MON','TUE','WED','THU','FRI','SAT']
S = str(input())

print(int(7 - l.index(S)))
S=input()

i=0
flag=0
while i<len(S) and len(S)>=2:
    if S[i] == 'h' and S[i+1] == 'i':
        i=i+2
    else:
        flag=1
        i=len(S)

if flag==0 and len(S)>=2:
    print('Yes')
elif flag==1 or len(S)<2:
    print('No')

### FIXED CODE ###

S=input()

i=0
flag=0
while i<len(S) and len(S)%2==0:
    if S[i] == 'h' and S[i+1] == 'i':
        i=i+2
    else:
        flag=1
        i=len(S)

if flag==0 and len(S)%2==0:
    print('Yes')
else:
    print('No')
c = input()

if c == a or c == i or  c == u or c == e or c == 0:
  print('vowel')
else:
  print('consonant')

### FIXED CODE ###

c = input()

if c == 'a' or c == 'i' or  c == 'u' or c == 'e' or c == 'o':
  print('vowel')
else:
  print('consonant')
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0 or :
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}.format(i), end='')
      break
    x //= 10

print()

### FIXED CODE ###

n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0:
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}'.format(i), end='')
      break
    x //= 10

print()
h,w = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
b = [list(map(int,input().split())) for _ in range(h)]

for i in range(h):
    for j in range(w):
        a[i][j] = abs(a[i][j] - b[i][j])

dp = [[0] * 12800 for _ in range(w)]
for i in range(h):
    for j in range(w):
        min_ = max(0, 6400 - min(i+j, 160-i-j)*80)
        max_ = min(12799, 6400 + min(i+j, 160-i-j)*80)
        if(i==0)&(j==0):
            dp[j][6400+a[i][j]] += 1
            dp[j][6400-a[i][j]] += 1
        elif(i==0):
            for k in range(min_, max_+1):
                dp[j][k+a[i][j]] += dp[j-1][k]
                dp[j][k-a[i][j]] += dp[j-1][k]
        elif(j==0):
            tmp = [0] * 12800
            for k in range(min_, max_+1):
                tmp[k+a[i][j]] += dp[j][k]
                tmp[k-a[i][j]] += dp[j][k]
            dp[j] = tmp[::]
        else:
            tmp = [0] * 12800
            for k in range(min_, max_+1):
                tmp[k+a[i][j]] += dp[j-1][k]
                tmp[k-a[i][j]] += dp[j-1][k]
                tmp[k+a[i][j]] += dp[j][k]
                tmp[k-a[i][j]] += dp[j][k]
            dp[j] = tmp[::]

ans = 6400
for i in range(6300, 6500):
    if(dp[-1][i] > 0):
        ans = min(ans, abs(i-6400))

print(ans)

### FIXED CODE ###

h,w = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
b = [list(map(int,input().split())) for _ in range(h)]

for i in range(h):
    for j in range(w):
        a[i][j] = abs(a[i][j] - b[i][j])

base = 2**12800 - 1
dp = [[0] * (w+1) for _ in range(h+1)]
dp[1][1] = (2**6400 >> a[0][0])|(2**6400 << a[0][0])&base
for i in range(1,h+1):
    for j in range(1,w+1):
        if(i==1)&(j==1):
            dp[1][1] = (2**6400 >> a[0][0])|(2**6400 << a[0][0])&base
            continue

        dp[i][j] = ((dp[i-1][j] >> a[i-1][j-1])|(dp[i-1][j] << a[i-1][j-1])|
                    (dp[i][j-1] >> a[i-1][j-1])|(dp[i][j-1] << a[i-1][j-1]))&base

ans = 6400
ans_bit = dp[-1][-1]
for i in range(6300,6500):
    if((ans_bit >> i)&1 == 1):
        ans = min(ans, abs(6400-i))

print(ans)
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

### FIXED CODE ###

a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, M = int(input())
node = [0]*(N+1)
for _ in range(M):
    a, b = map(lambda x: int(x)-1, input().split())
    node[a] += 1
    node[b] += 1

if all(x % 2 == 0 for x in node):
    print("YES")
else:
    print("NO")


### FIXED CODE ###

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
N, M = map(int, input().split())
node = [0]*(N+1)
for _ in range(M):
    a, b = map(lambda x: int(x)-1, input().split())
    node[a] += 1
    node[b] += 1

if all(x % 2 == 0 for x in node):
    print("YES")
else:
    print("NO")
count=0
k,s=map(int,input().split())
for i in range(s):
  for j in range(s-i):
    for m in range(s-i-j):
      if i<=k ans j<=k ans m<=k:
        count+=1
print(count)

### FIXED CODE ###

count=0
k,s=map(int,input().split())
for i in range(k+1):
  for j in range(k+1):
    if s-k<=i+j<=s:
      count+=1
print(count)
n, k = input().split()
n = int(n)
k = int(k)

MOD = 1000000007

g = [[] for i in range(n)]

for i in range(n-1):
    a, b = input().split()
    a = int(a)-1
    b = int(b)-1
    g[a].append(b)
    g[b].append(a)

used = [False for i in range(n)]

def dfs(v):
    used[v] = True
    ret = 1
    num = k-2
    for to in g[v]:
        if not used[to]:
            if num < 0:
                num = 0
            ret *= num * dfs(to)
            num -= 1

    return ret

ans = k
num = k-1
used[0] = True
for to in g[0]:
    if not used[to]:
        if num < 0:
            num = 0
        ans *= num * dfs(to)
        num -= 1


print(ans%MOD)


### FIXED CODE ###

from collections import deque

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

MOD = 1000000007

g = [[] * 1 for i in range(n)]

for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

d = [-1 for i in range(n)]

q = deque([])
num = k-1
d[0] = k
for to in g[0]:
    if d[to] == -1:
        d[to] = num
        num -= 1
        if num < 0:
            num = 0
        q.append(to)

while q:
    v = q.popleft()
    num = k-2
    for to in g[v]:
        if d[to] == -1:
            d[to] = num
            num -= 1
            if num < 0:
                num = 0
            q.append(to)

ans = 1
for i in d:
    ans *= i
    ans %= MOD

print(ans)
import math

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
numbers = [abs(i - X) for i in x]

gcd = numbers[0]
for i in numbers:
  gcd = math.gcd(gcd, i)
print(gcd)


### FIXED CODE ###

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

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
numbers = [abs(i - X) for i in x]

answer = numbers[0]
for i in numbers:
  answer = gcd(answer, i)
print(answer)
x = int(input)
print x**3

### FIXED CODE ###

x = int(input())
print(x**3)