Harryxun/stf_run huggingface dataset:
from scipy.special import comb

r1, c1, r2, c2 = [int(i) for i in input().split()]

def calc(r, c):
    a = comb(r + c + 2, r + 1, exact=True) - r - c - 2
    b = r * (r + 3) / 2

    if c == 1:
        return b
    else:
        return a

result = calc(r2, c2) - calc(r2, c1 - 1) - calc(r1 - 1, c2) + calc(r1 - 1, c1 - 1)

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

### FIXED CODE ###

from operator import mul
from functools import reduce

def comb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 3 * 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
    
    
    
r1, c1, r2, c2 = [int(i) for i in input().split()]
 
def calc(r, c):
    a = comb(r + c + 2, r + 1, mod) - r - c - 2
    b = r * (r + 3) / 2
 
    if c == 1:
        return b
    else:
        return a
 
result = calc(r2, c2) - calc(r2, c1 - 1) - calc(r1 - 1, c2) + calc(r1 - 1, c1 - 1)
result %= mod
if result < 0:
  result += mod
print(result)
def comb(n, r):
    if r >= n:
        return 0
    else:        
        return math.factorial(n) // (math.factorial(r)*math.factorial(n - r))
  
n, m = map(int, input().split())
print(int(comb(n,2) + comb(m,2)))

### FIXED CODE ###

n, m = map(int, input().split())
print(int(n*(n-1)//2 + m*(m-1)//2))
#!/usr/bin/env python3


def main():
    S = input()
    judge = 0
    t = S
    if S[0] == "A":
        judge += 1
        S[0] = S[0].lower()
    else:
        print("WA")
        exit()
    if S[1] == "C":
        print("WA")
        exit()
    if S[2:-2].count("C") == 1:
        judge += 1
        for n, i in enumerate(S[2:-2]):
            n += 3
            if i == "C":
                S[n] = S[n].lower()
    else:
        print("WA")
        exit()
    if S[-1] == "C":
        print("WA")
        exit()
    if S.islower():
        judge += 1
    else:
        print("WA")
        exit()
    if judge == 3:
        print("AC")
    else:
        print("WA")
        exit()


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3


def main():
    S = list(input())
    judge = True
    if S[0] == "A":
        S[0] = S[0].lower()
    else:
        judge = False
    if S[1] == "C":
        judge = False
    if S[2:-1].count("C") == 1:
        for n, i in enumerate(S):
            if 2 <= n <= len(S) - 1:
                if i == "C":
                    S[n] = S[n].lower()
    else:
        judge = False
    if S[-1] == "C":
        judge = False
    S = "".join(S)
    if S.islower() == False:
        judge = False
    if judge:
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    main()
A=int(input())
B=int(input())
C=(A-1)*(B-1)
print(C)

### FIXED CODE ###

A,B=list(map(int,input().split()))
C=(A-1)*(B-1)
print(C)
import sys
s=sys.stdin
r=readline()
while 1:
 n=int(s.r)
 if n==0:break
 d={}
 for _ in[0]*n:
  k,v=s.r.strip().split()
  d[k]=v
 a=''
 for _ in[0]*int(s.readline()):
  e=s.r.strip()
  a+=d[e]if e in d else e
 print(a)


### FIXED CODE ###

import sys
s=sys.stdin.readline
for n in iter(s,'0\n'):
 d={}
 for _ in[0]*int(n):e=s();d[e[0]]=e[2]
 print(''.join(d.get(*[s()[0]]*2)for _ in[0]*int(s())))
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i,j,k in zip(a,b,c):
  ans += len(set(i,j,k))-1
print(ans)

### FIXED CODE ###

n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i,j,k in zip(a,b,c):
  ans += len(set([i,j,k]))-1
print(ans)
import math
n = int(input())
a = []
b= []
while n % 2 == 0:
    b.append(2)
    n //= 2
if(len(b)!= 0):
    a.append(b)
    b= [] 
f = 3
while f * f <= n:

    if n % f == 0:
        b.append(f)
        n //= f
    else:
        f += 2
        if(len(b)!= 0):
            a.append(b)
            b= [] 

       
if(len(b)!= 0):
        a.append(b)
        b= [] 
if (n != 1 ):
    if(n == a[len(a)-1][0]):
        a[len(a)-1].append(n)
    else:
        b.append(n)
        a.append(b)

ans =0
for i in range(len(a)):
    ans += int((-1 + math.sqrt(1 + 8 * len(a[i])))/2)

print(ans)


### FIXED CODE ###

import math
n = int(input())
a = []
b= []
while n % 2 == 0:
    b.append(2)
    n //= 2
if(len(b)!= 0):
    a.append(b)
    b= [] 
f = 3
while f * f <= n:

    if n % f == 0:
        b.append(f)
        n //= f
    else:
        f += 2
        if(len(b)!= 0):
            a.append(b)
            b= [] 

if(len(b)!= 0):
        a.append(b)
        b= [] 
if(len(a) != 0):
    if(n == a[len(a)-1][0]):
        a[len(a)-1].append(n)
        n  = 1
if (n != 1 ):
    b.append(n)
    a.append(b)

ans =0
for i in range(len(a)):
    ans += int((-1 + math.sqrt(1 + 8 * len(a[i])))/2)

print(ans)
N=int(input())
A=list(map(int,input().split()))
S=0
B=[0]*10**5
for i in A:
    S+=i
    B[i]=A.count(i)  #Bは要素数管理
Q=int(input())
C=[list(map(int,input().split())) for i in range(Q)]
for i in range(Q):
    S=S+(C[i][1]-C[i][0])*B[C[i][0]]
    B[C[i][1]]=B[C[i][0]]+B[C[i][1]]
    B[C[i][0]]=0
    print(S)


### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
S=0
B=[0]*(10**5+1)
for i in A:
    S+=i
    B[i]+=1  #Bは要素数管理
Q=int(input())
C=[list(map(int,input().split())) for i in range(Q)]
for i in range(Q):
    S=S+(C[i][1]-C[i][0])*B[C[i][0]]
    B[C[i][1]]=B[C[i][0]]+B[C[i][1]]
    B[C[i][0]]=0
    print(S)
n = int(input())
alist=list(map(int,input().split()))
core = 0
for i in range(1,n-1):
  core +=min(alist[i-1],alist[i],alist[i+1])
print(core +min(alist[-2],alist[-1]) +alist[-1] +min(alist[0],alist[1]))

### FIXED CODE ###

n = int(input())
alist=list(map(int,input().split()))
alist.insert(0,1e7)
alist.append(1e7)
core = 0
for i in range(n):
  core +=min(alist[i],alist[i+1])
print(core)
a = input()
if "RRR" in a:
  print(3)
  elif "RR" in a:
      print(2)
  elif "R" in a:
      print(1)
  else:
      primt(0)

### FIXED CODE ###

a = input()
if "RRR" in a:
  print(3)
elif "RR" in a:
  print(2)
elif "R" in a:
  print(1)
else:
  print(0)
from collections import deque
S=list(input())
Q=int(input())
Qlst=[list(input().split()) for _ in range(Q)]

len_S=len(S)
s0=deque(sorted(S[:len_S//2]))
s1=deque(S[len_S//2:])

if len_S%2!=0:
    mid=s1.popleft()
else:
    mid=''

fflag=0
for i in range(Q):
    q=Qlst[i]
    if q[0]=='1':
        fflag=abs(fflag-1)
        continue
    if q[1]=='1':
        if fflag==0:
            s0.append(q[2])
            if mid=='':
                mid=s0.popleft()
            else:
                s1.insert(0,mid)
                mid=''
        else:
            s1.append(q[2])
            if mid=='':
                mid=s1.popleft()
            else:
                s0.insert(0,mid)
                mid=''
    elif q[1]=='2':
        if fflag==0:
            s1.append(q[2])
            if mid=='':
                mid=s1.popleft()
            else:
                s0.append(mid)
                mid=''
        else:
            s0.append(q[2])
            if mid=='':
                mid=s0.popleft()
            else:
                s1.append(mid)
                mid=''

if fflag==0:
    s0.reverse()
    print(''.join(s0)+mid+''.join(s1))
else:
    s1.reverse()
    print(''.join(s1)+mid+''.join(s0))

### FIXED CODE ###

from collections import deque

S=list(input())
Q=int(input())
Sq=deque(S)

flag=1
for _ in range(Q):
    q=input().split()
    if q[0]=='1':
        flag*=-1
        continue
    if (q[1]=='1' and flag==-1) or (q[1]=='2' and flag==1):
        Sq.append(q[2])
    else:
        Sq.appendleft(q[2])
if flag==1:
    print(''.join(Sq))
else:
    Sq.reverse()
    print(''.join(Sq))
def test(original: list, array: list, index: int,
         remain_count: int, results: set):
    if index == len(original):
        if remain_count == 0:
            # print("".join(array))
            results.add("".join(array))
        return
    if remain_count > 0:
        test(original, array[:], index + 1, remain_count - 1, results)
    new_array = array[:]
    new_array.append(
        original[index])
    test(
        original,
        new_array,
        index + 1,
        remain_count,
        results)


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

results = set()

# N個の要素
# N-3個を削除
# 3個の組み合わせが何通りあるか？
test(S, [], 0, N - 3, results)

print(len(results))


### FIXED CODE ###

def test(original: list, nums: str, index: int,
         remain_count: int, results: set, results_1, results_2):
    # 3桁抽出したら終了
    if len(nums) == 1:
        if nums in results_1:
            return
        results_1.add(nums)
    if len(nums) == 2:
        if nums in results_2:
            return
        results_2.add(nums)
    if len(nums) == 3:
        # print("".join(array))
        results.add(nums)
        return
    # 最終桁に到達したら終了
    if index == len(original):
        return
    for i in range(index, len(original), 1):
        test(
            original,
            nums + original[i],
            i + 1,
            remain_count,
            results,
            results_1,
            results_2)

    # この桁を抽出対象としないパターン
    # test(original, array[:], index + 1, remain_count - 1, results)


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

results = set()
results_1 = set()
results_2 = set()

# N個の要素
# N-3個を削除
# 3個の組み合わせが何通りあるか？
test(S, "", 0, N - 3, results, results_1, results_2)

print(len(results))
import numpy as np
N,K=map(int,input().split())
a=[[int(i) for i in input().split()] for _ in range(N)]
a=np.array(a,dtype=np.int64)
MOD=10**9+7

def matmul(A,B,MOD):
    N=len(A)
    C=np.zeros(N,dtype=np.int64)
    for i in range(N):
        for j in range(N):
            for k in range(N):
            C[i][j] += A[i][k]B[k][j]%MOD
    return C

def mat_power(A,k,MOD):
    N=len(A)
    D=np.identity(N,dtype=np.int64)
    while k:
        if k & 1:
            D=matmul(D,A,MOD)
        A = matmul(A,A,MOD)
        k >>= 1

    return D

A=mat_power(a,K,MOD)
ans=0
for i in range(N):
    for j in range(N):
        ans=(ans+A[i][j])%MOD

print(ans)

### FIXED CODE ###

import numpy as np
N,K=map(int,input().split())
a=[[int(i) for i in input().split()] for _ in range(N)]
a=np.array(a,dtype=np.int64)
MOD=10**9+7

def matmul(A,B,MOD):
    N=len(A)
    C=np.zeros((N,N),dtype=np.int64)

    for n in range(N):
        C[n] = (A[n,:][:,None] * B % MOD).sum(axis=0) % MOD
    return C

def mat_power(A,k,MOD):
    N=len(A)
    D=np.identity(N,dtype=np.int64)
    while k:
        if k & 1:
            D=matmul(D,A,MOD)
        A = matmul(A,A,MOD)
        k >>= 1

    return D

A=mat_power(a,K,MOD)
ans=0
for i in range(N):
    for j in range(N):
        ans=(ans+A[i][j])%MOD

print(ans)
N, M = map(int, input().split())

graph = [[] for i in range(M)]
for i in range(M):
    v, e = map(int, input().split())
    graph[v - 1].append(e - 1)
    graph[e - 1].append(v - 1)

def dfs(v, seen, res):
    end = True
    for i in range(len(seen)):
        if seen[i] == False and i != v:
            end = False
    if end:
        res[0] += 1
        return
    seen[v] = True
    for i in graph[v]:
        if seen[i]:
            continue
        dfs(i, seen, res)
    seen[v] = False

res = [0]
seen = [False] * N
dfs(0, seen, res)
print(res[0])

### FIXED CODE ###

N, M = map(int, input().split())
G = [[] for _ in range(N)]
seen = [False] * N
for i in range(M):
    a, b = map(lambda x: int(x) - 1 ,input().split())
    G[a].append(b)
    G[b].append(a)

def dfs(x, G, seen):
    seen[x] = True
    flag = True
    for i in seen:
        if i == False:
            flag = False
    if flag:
        return 1
    res = 0
    for i in G[x]:
        if seen[i]:
            continue
        res += dfs(i, G, seen)
        seen[i] = False
    return res

print(dfs(0, G, seen))
N, K = tuple(map(int ,input().split(' ')))

print( K * int(power(float(K), float(N - 1))) )

### FIXED CODE ###

N, K = tuple(map(int ,input().split(' ')))
 
print( K * int(pow(float(K - 1), float(N - 1))) )
n=int(input())
dat=list(map(int, input().split()))
      
re = 0
flag=True
while (flag==True):
       for e in dat:
            if (e%2==1):
                flag=False
                break
            else:
                e = e/2
        re = re+1

print(re)

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
def solve(i,sum):
    if i==n:
        ans[sum] = 1
        if sum+A[i] <= 2000:
            ans[sum+A[i]] = 1
    solve(i+1,sum)
    if sum+A[i] <= 2000:
        solve(i+1,sum+A[i])

n=int(input())
A=[]*n
A=list(input().split())
for i in range(n):
    A[i]=int(A[i])
ans=[0]*2001    
solve(0,0)   

m=int(input())
B=list(input().split())
for i in range(m):
    B[i]=int(B[i])
for i in range(m):
    if ans[B[i]]==1:
        print("yes")
    else:
        print("no")



### FIXED CODE ###

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

T = [[0]*2001 for i in range(n)]

T[0][0] = 1
T[0][A[0]] = 1
for i in range(1,n):
    for j in range(2001):
        T[i][j] = T[i-1][j]
        if (j - A[i] >=0) and (T[i-1][j-A[i]] == 1):
            T[i][j] = 1
    
for i in range(m):
    if T[n-1][B[i]] == 1: print("yes")
    else: print("no")
A = int(input())
B = input()
m = 0
for i in range(A):
  c = set(B[:i])
  a = set(B[i:])
  l = a & c
  m = max(m,len(l))
print(m)

### FIXED CODE ###

A = input()
B = int(A)
b = 0
for _ in range(len(A)):
  b += B % 10
  B = B//10
if int(A) % b == 0:
  print('Yes')
else:
  print('No')
import math
a,b,x=map(int,input().split())
if a*a*b/2<x:
  print(math.degrees(math.atan(a*a*b/2*x)))
else:
  print(math.degrees(math.atan(2-2*x/a*a*b)))

### FIXED CODE ###

a,b=map(int,input().split())
if a<10 and b<10:
  print(a*b)
else:
  print(-1)
N, X = map(int, input().split())
L = [int(i) for i in input().split()]
step = 0
i = 0

while step <= X and i <= N:
    step += L[i]
    i += 1

print(i)

### FIXED CODE ###

N, X = map(int, input().split())
L = [int(i) for i in input().split()]
step = [0]
nowstep = 0
ans = 0
i = 0

while i < N:
    step.append(nowstep + L[i])
    nowstep += L[i] 
    i += 1

for i in range(len(step)):
    if step[i] <= X:
        ans += 1
    else:
        pass

print(ans)
a,b=map(int,input().split())
if (a >=1) AND (a <= 20) AND (b >=1) AND (b =< 20):
  print(a*b)
else:
  print("-1")

### FIXED CODE ###

a,b=map(int,input().split())
if 1<=a<=9 and 1<=b<=9:
  print(a*b)
else:
  print("-1")
from collections import deque
A = deque(input())
while A != deque() and A != deque([0]):
    if list(A)[:7] == list("dreamer") and list(A)[5:10] != list("erase"):
        for _ in range(7):
            A.leftpop()
    elif A[:5] == list("dream"):
        for _ in range(5):
            A.leftpop()
    elif A[:6] == list("eraser"):
        for _ in range(6):
            A.leftpop()
    elif A[:5] == list("erase"):
        for _ in range(5):
            A.leftpop()
    else:
        A = [0]
if A == []:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

s = input().replace("eraser", "").replace("erase", "")
s = s.replace("dreamer", "").replace("dream", "")
if s:
    print("NO")
else:
    print("YES")
S = input()
a = 0
for i in range(len(S)//2):
  if S[i] != S[-i-1]:
    S[i] = S[-i-1]
    a += 1
print(a)

### FIXED CODE ###

S = list(input())
a = 0
for i in range(len(S)//2):
  if S[i] != S[-(i+1)]:
    S[i] = S[-(i+1)]
    a += 1
print(a)
N = int(input())
X = input()

d = [0 for _ in range(N)]
for i in range(1, N):
    v = i % bin(i)[2:].count("1")
    d[i] = d[v] + 1
   
for i in range(N):
    if X[i] == "0":
        x = X[:i] + "1" + X[i+1:]
    else:
        x = X[:i] + "0" + X[i+1:]
    val = int(x, 2) % x.count("1")
    print(d[val] + 1)


### FIXED CODE ###

N = int(input())
X = input()

a = int(X, 2)
b = X.count("1")

if b > 1:
    a1 = a % (b-1)
else:
    a1 = 0
a0 = a % (b+1)

for i in range(N):
    if X[i] == "1":
        if b == 1:
            print(0)
            continue
        t = (a1 - pow(2, N-1-i, b-1)) % (b-1)
    else:
        t = (a0 + pow(2, N-1-i, b+1)) % (b+1)
    
    ans = 1
    while t > 0:
        t %= bin(t).count("1")
        ans += 1
    print(ans)
import sys
sys.setrecursionlimit(10**5)
N=int(input())
MOD=10**9+7
def seki(x):
	if x<2:
		return 1
	else:
		return x*seki(x-1)%MOD
print(seki(N)%MOD)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
N=int(input())
MOD=10**9+7
def seki(x):
	if x<2:
		return 1
	else:
		return x*seki(x-1)%MOD
print(seki(N)%MOD)
import numpy as np

a = int(input())
h = np.array(list(range(1,a+1)))
h2 = h[::-1]
temp = int(0)
index_val = int(0)
max_mod = int(0)
sum_mod = int(0)

for value in h2:
  for index in range(len(h)):
    temp = value % h[index]
    if temp > max_mod:
      max_mod = temp
      index_val = index
  sum_mod += max_mod
  max_mod = 0
  np.put(h,index_val,0)

if a!=1:
  print(sum_mod+1)
else:
  print(0)

### FIXED CODE ###

import numpy as np

a = int(input())
answer = a*(a-1)//2

print(int(answer))
s=input()
n=len(s)
lst=[]
cnt=1

if n==2:
  print(1)
  
for i in range(n-2):
  if s[i]==s[i+1]:
    cnt+=1
  else:
    lst.append(cnt)
    cnt-=(cnt-1)
    
totl=0
l=len(lst)
if s[0]=='<':
  for j in range(l):
    if j%2==0:
      totl+=(lst[j]*(lst[j]-1))//2
      totl+=max(lst[j],lst[min(j+1,l-1)])
    else:
      totl+=(lst[j]*(lst[j]-1))//2
  print(totl)
else:
  totl+=lst[0]
  for j in range(len(lst)):
    if j%2==1:
      totl+=(lst[j]*(lst[j]-1))//2
      totl+=max(lst[j],lst[min(j+1,l-1)])
    else:
      totl+=(lst[j]*(lst[j]-1))//2
  print(totl)

      
      
      
      
      
  


### FIXED CODE ###

s=input()
n=len(s)
lst=[]
cnt=1

if n==2:
  print(1)
  
for i in range(n-1):
  if s[i]==s[i+1]:
    cnt+=1
  else:
    lst.append(cnt)
    cnt-=(cnt-1)

if s[n-2]!=s[n-1]:
  lst.append(1)
else:
  lst.append(cnt)
    
totl=0
l=len(lst)
if s[0]=='<':
  for j in range(l):
    if j%2==0:
      totl+=(lst[j]*(lst[j]-1))//2
      totl+=max(lst[j],lst[min(j+1,l-1)])
    else:
      totl+=(lst[j]*(lst[j]-1))//2
  print(totl)
else:
  totl+=lst[0]
  for j in range(len(lst)):
    if j%2==1:
      totl+=(lst[j]*(lst[j]-1))//2
      totl+=max(lst[j],lst[min(j+1,l-1)])
    else:
      totl+=(lst[j]*(lst[j]-1))//2
  print(totl)
#標準入力からKを求めるまで
N = int(input())
node = [0] * N
AB = []
for i in range(N-1):
    ab = list(map(int, input().split()))
    node[ab[0] - 1] += 1
    node[ab[1] - 1] += 1
    AB.append(ab)
K = max(node)
print(K)

#各辺の色を求めていく
color = [[ i for i in range(1, K + 1)] for i in range(N)]
for i in range(N-1):
    now = list(set(color[AB[i][0]-1]) & set(color[AB[i][1] - 1]))
    tmp = now[0]
    color[AB[i][0]-1].remove(tmp)
    color[AB[i][1]-1].remove(tmp)
    print(tmp)


### FIXED CODE ###

#グラフ構造DFSを使う
import sys
sys.setrecursionlimit(500000)
N = int(input())
ans = [-1] * (N-1)
g = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    g[a-1].append((b-1, i))
    g[b-1].append((a-1, i))

def bfs(v, c, p):
    n_c = 1
    for i in range(len(g[v])):
        to = g[v][i][0]
        ID = g[v][i][1]
        if to == p:
            continue
        if n_c == c:
            n_c += 1
        ans[ID] = n_c
        bfs(to, n_c, v)
        n_c += 1

bfs(0, 0, -1)
print(max(ans))
for i in range(N-1):
    print(ans[i])
import math

def get_nearest_bin(x):
	if x <= 1:
		return x
	y = x
	i=0
	while y !=0:
		y = y >> 1
		i += 1
	return (x >> (i-1) ) << (i-1)

def func(x):
	if x <= 3:
		return {0:0,1:1,2:3,3:0}[x]
	
	nearest_bin = get_nearest_bin(x)

	if ((x-nearest_bin + 1) %2) == 0:
		ans = 0
	else:
		ans = nearest_bin

	return nearest_bin ^ func(x - nearest_bin)


A,B = map(int,input().split())

if A == B:
	print(A)
else:
	print(func(A-1)^func(B))

### FIXED CODE ###

import math

def get_nearest_bin(x):
	if x <= 1:
		return x
	y = x
	i=0
	while y !=0:
		y = y >> 1
		i += 1
	return (x >> (i-1) ) << (i-1)

def func(x):
	if x <= 3:
		return {0:0,1:1,2:3,3:0}[x]
	
	nearest_bin = get_nearest_bin(x)

	if ((x-nearest_bin + 1) %2) == 0:
		ans = 0
	else:
		ans = nearest_bin

	return ans ^ func(x - nearest_bin)


A,B = map(int,input().split())

if A == B:
	print(A)

elif A == 0:
	print(func(B))
else:
	print(func(A-1)^func(B))
n=int(input())
l=list(map(int,input().split()))
from collections import defaultdict
d=defaultdict(int)
l1=set(l)
l2=[]
for i in l:
  d[i]+=1
if len(d)==1:
  if l[0]==0:
    print("Yes")
  else:
    print("No")
elif len(d)==2:
  for i in l1:
    l2.append(i)
  bool1=True
  if d[l2[0]]==d[l2[1]]*2:
    a=l2[0]
    b=l2[0]
    c=l2[1]
  elif d[l2[0]]*2==d[l2[1]]:
    a=l2[0]
    b=l2[1]
    c=l2[1]
  else:
    boo11=False
  if bool1:
    l2=[a,b,c]
    l2=sorted(l2)
    a=l2[2]
    b=l2[1]
    c=l2[0]
    la=[]
    lb=[]
    lc=[]
    while a!=0:
      la.append(a%2)
      a=a//2
    while b!=0:
      lb.append(b%2)
      b=b//2
    while c!=0:
      lc.append(c%2)
      c=c//2
    while len(lb)<len(la):
      lb.append(0)
    while len(lc)<len(la):
      lc.append(0)
    bool1=True
    for i in range(len(la)):
      if la[i]+lb[i]+lc[i]==1 or la[i]+lb[i]+lc[i]==3:
        bool1=False
    if bool1:
      print("Yes")
    else:
      print("No")
  else:
    print("No")  
elif len(d)==3:
  for i in l1:
    l2.append(i)
  l2=sorted(l2)
  if d[l2[0]]==d[l2[1]] and d[l2[1]]==d[l2[2]]:
    a=l2[2]
    b=l2[1]
    c=l2[0]
    la=[]
    lb=[]
    lc=[]
    while a!=0:
      la.append(a%2)
      a=a//2
    while b!=0:
      lb.append(b%2)
      b=b//2
    while c!=0:
      lc.append(c%2)
      c=c//2
    while len(lb)<len(la):
      lb.append(0)
    while len(lc)<len(la):
      lc.append(0)
    bool1=True
    for i in range(len(la)):
      if la[i]+lb[i]+lc[i]==1 or la[i]+lb[i]+lc[i]==3:
        bool1=False
    if bool1:
      print("Yes")
    else:
      print("No")           
  else:
    print("No")
else:
  print("No")

### FIXED CODE ###

n=int(input())
def xor(x,y):
  bitx=[]
  bity=[]
  num1,num2=x,y
  while num1!=0:
    bitx.append(num1%2)
    num1//=2
  while num2!=0:
    bity.append(num2%2)
    num2//=2
  m=max(len(bitx),len(bity))
  while len(bitx)<m+1:
    bitx.append(0)
  while len(bity)<m+1:
    bity.append(0)
  ans=0
  for i in range(m):
    if bitx[i]!=bity[i]:
      ans+=2**i
  return ans
from collections import defaultdict
import sys
d=defaultdict(int)
l=list(map(int,input().split()))
if n%3!=0:
  for i in range(n):
    if l[i]!=0:
      print("No")
      sys.exit()
  print("Yes")
  sys.exit()
for i in l:
  d[i]+=1
if len(d)>3:
  print("No")
elif len(d)==3:
  b=True
  l1=[]
  for i in d:
    l1.append(i)
    if d[i]!=n/3:
      b=False
  if l1[0]!=xor(l1[1],l1[2]) or l1[1]!=xor(l1[0],l1[2]) or l1[2]!=xor(l1[0],l1[1]):
    b=False
  if b:
    print("Yes")
  else:
    print("No")
elif len(d)==2:
  if d[0]!=n/3:
    print("No")
  else:
    print("Yes")
else:
  if d[0]==n:
    print("Yes")
  else:
    print("No")
n,k = map(int,input().split())
d = list(map(int,input().split()))

n_str = str(n)
l = len(n_str)
a = [i for i in range(10) if i not in d]

#同じ桁の時
ans = ""
for i in range(l):
    for j in a:
        if j == int(n_str[i]):
            ans += str(j)
            break
        elif j > int(n_str[i]):
            ans += str(j) + str(a[0])*(l-i-1)
            print(ans)
            exit()

if int(ans) >= n:
    print(ans)
    exit()

if 0 in a:
    ans = str(a[1]) + str(a[0])*l
else:
    ans = str(a[0])*(l+1)

print(ans)

### FIXED CODE ###

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

n_str = str(n)
l = len(n_str)
a = [i for i in range(10) if i not in d]

#同じ桁の時
ans = ""
for i in range(l):
    for j in a:
        if j == int(n_str[i]):
            ans += str(j)
            break
        elif j > int(n_str[i]):
            ans += str(j) + str(a[0])*(l-i-1)
            print(ans)
            exit()

if len(ans)>0:
    if int(ans) >= n:
        print(ans)
        exit()

if 0 in a:
    ans = str(a[1]) + str(a[0])*l
else:
    ans = str(a[0])*(l+1)

print(ans)
age = int(input())
yen = int(input())
if 0 <= age <= 5:
    print(0)
if 6 <= age <= 12:
    print(yen//2)
if 16 <= age <= 100:
    print(yen)

### FIXED CODE ###

a, b = map(int, input().split())
if a >= 13:
    print(b)
elif a >= 6 and a <= 12:
    print(int(b /2))
else:
    print(0)