Harryxun/stf_run huggingface dataset:
import fractions
N=int(input())
a = list(map(int, input().split()))

#------------最小公倍数---------------------
lcm = a[0]
for i in range(1, N):
    lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
#------------------------------------------
ans=0

for j in a:
    ans += lcm // j
ans %= 1000000007
print(ans)

### FIXED CODE ###

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

if n==m:
  print("Yes")
else:
  print("No")
import numpy as np
N,M,C = map(int,input().split(' '))
B = np.array(list(map(int,input().split(' '))))
As = [list(map(int,input().split(' '))) for i in [0]*N]

ans = 0
for A in As:
	if np.sum(A*B) + C > 0:
		ans += 1
print(ans)


### FIXED CODE ###

import numpy as np
N,M,C = map(int,input().split(' '))
B = np.array(list(map(int,input().split(' '))))
As = [list(map(int,input().split(' '))) for i in [0]*N]

ans = 0
for A in As:
	if np.sum(A*B) + C > 0:
		ans += 1
print(ans)
n=int(input())
w=list(map(int, input().split()))
min=10000
for i in range(1,n+1):
	if abs(sum(w[:i])-sum(w[i:])<min:
		min=abs(sum(w[:i])-sum(w[i:])
print(min)

### FIXED CODE ###

n=int(input())
w=list(map(int, input().split()))
m=10000
for i in range(1,n+1):
	if abs(sum(w[:i])-sum(w[i:]))<m:
		m=abs(sum(w[:i])-sum(w[i:]))
print(m)
N, A, B = map(int, input().split())

if N >= AB:
    iters, div = divmod(N, (A +B))
    print((A*iters + div))
else:
    print(A)

### FIXED CODE ###

N, A, B = map(int, input().split())
AB = A + B

if N >= AB:
    iters, div = divmod(N, AB)
    if div <= A:
        print((A*iters + div))
    else:
        print((A*(iters + 1)))
elif N >= A:
    print(A)
else:
    print(N)
n = list(input())
if int("".join(n)) % 1000 == 0:
    print("0")
else:
    print((10 - int(n[-3])) * 100)


### FIXED CODE ###

n = int(input())
if n % 1000 == 0:
    print("0")
else:
    print(((n // 1000) + 1) * 1000 - n)
n=int(input())
a=list(map(int,input().split()))
buka=[0]*n
for i in a:
  s[i]=s[i]+1
for i in buka:
  print(i)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
buka=[0]*n
for i in a:
  buka[i-1]=buka[i-1]+1
for i in buka:
  print(i)
import math
import sys

N = int(input())
max = math.ceil(math.log(abs(N), 2)) + 3

result = []
numerator = N
for i in range(0, max):
    if numerator % (math.pow(2, i + 1)) == 0:
        result.append(str(0))
    else:
        result.append(str(1))
        numerator -= math.pow(-2, i)

    if numerator == 0:
        break
result.reverse()
print("".join(result))

### FIXED CODE ###

import math
import sys

N = int(input())
if N == 0:
    max = 1
else:
    max = math.ceil(math.log(abs(N), 2)) + 3

result = []
numerator = N
for i in range(0, max):
    if numerator % (math.pow(2, i + 1)) == 0:
        result.append(str(0))
    else:
        result.append(str(1))
        numerator -= math.pow(-2, i)

    if numerator == 0:
        break
result.reverse()
print("".join(result))
import collections
x, n = map(int,input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(max(max(P),x)):
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

### FIXED CODE ###

import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0

for i in range(100):
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)
a = int(input())
s = input()
k = int(input())

t = ["*"]*a
aa = s[k]
for f,i in enumerate(s):
  if i == aa:
    t[f] = i
print("".join(t))


### FIXED CODE ###


a = int(input())
s = input()
k = int(input())

t = ["*"]*a
aa = s[k-1]
for f,i in enumerate(s):
  if i == aa:
    t[f] = i
print("".join(t))
a = int(input())
b = int(input())
x = 0
 
if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if i % a == 0:
          x += 1
  if x == len(b):
      print('APPROVED')
  else:
      print('DENIED')

### FIXED CODE ###

a,b,c = map(int, input().split())
 
if (a == b) and (b !=c):
	print('Yes')
elif (a == c) and (b !=c):
	print('Yes')
elif (b == c) and (a !=c):
	print('Yes')
else:
	print('No')
X=int(input())
Y=int(input())
Z=int(input())
X ^= Z
Z ^= X
X ^= Z

Y ^= Z
Z ^= Y
Y ^= Z
print(X,Y,Z)
      

### FIXED CODE ###

A,B,C=map(int,input().split())
print(C,A,B)
n,k=map(int,input().split())
a=list(map(int,input().split()))
m=[]
for i in [0,1,2,3,4,5.6,7,8,9]:
  if i not in a:
    m.append(i)
k=0
for a in m:
  for b in m:
    for c in m:
      for d in m:
        num=a*1000+b*100+c*10+d
        if k==0 and num>=n:
          ans=num
          k=1
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
m=list(map(int,input().split()))
for i in range(n,100000):
  k=1
  for a in str(i):
    if int(a) in m:
      k=0
  if k:
    print(i)
    break
from collections import defaultdict

N, Q = map(int, input().split())
e = [[] for _ in range(N + 1)]
for i in range(N - 1):
    a, b = map(int, input().split())
    e[a].append(b)

q = defaultdict(int)
for i in range(Q):
    p, x = map(int, input().split())
    q[p] += x

seen = [False] * (N + 1)
oya = [[] for _ in range(N + 1)]


def dfs(e, v):
    seen[v] = True
    oya[v].append(v)
    for next_v in e[v]:
        oya[next_v].extend(oya[v])
        if seen[next_v]:
            continue
        else:
            dfs(e, next_v)


dfs(e, 1)
ans = [0] * (N + 1)
for i in range(N + 1):
    for j in oya[i]:
        ans[i] += q[j]

print(*ans[1:])


### FIXED CODE ###

from collections import defaultdict
import sys
input = sys.stdin.readline

sys.setrecursionlimit(10**6)

N, Q = map(int, input().split())
e = [[] for _ in range(N + 1)]
for i in range(N - 1):
    a, b = map(int, input().split())
    e[a].append(b)

q = defaultdict(int)
for i in range(Q):
    p, x = map(int, input().split())
    q[p] += x

seen = [False] * (N + 1)
ans = [0] * (N + 1)


def dfs(e, v, x):
    seen[v] = True
    ans[v] += x
    for next_v in e[v]:
        if seen[next_v]:
            continue
        else:
            dfs(e, next_v, x + q[next_v])


dfs(e, 1, q[1])
print(*ans[1:])
N=input()
P=[int(i) for i in input().split()]
mes=[]

for i in range(len(P)):

	if i!=1 and i!=N-1:
		if (P[i+1]<P[i] and P[i+1]<=P[i-1]) or (P[i+1]<P[i] and P[i+1]<=P[i-1]):
			mes+=mes+P[i]

for n in mes:
	print(mes[n])


### FIXED CODE ###

N=int(input())
P=[int(i) for i in input().split()]
mes=0
for i in range(len(P)):

	if i!=0 and i!=N-1:
		if (P[i+1]<P[i] and P[i+1]<=P[i-1] and P[i]<=P[i-1])or(P[i-1]<P[i] and P[i-1]<=P[i+1] and P[i]<=P[i+1]):
			mes+=1
print(mes)
import collections

N = int(input())
A = list(map(int, input().split()))

mod = 10**9+7

def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if is_prime[i]:
            for j in range(i*2, n+1, i):
                is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]

primes = sieve(10**3)

def primeFactorization(n):
    ans = []
    temp = n
    for p in primes:
        while temp%p == 0:
            ans.append(p)
            temp /= p
    if temp > 1:
        ans.append(temp)
    return collections.Counter(ans)

AFactorized = list(map(primeFactorization, A))

lcm = collections.Counter()
for a in AFactorized:
    for p, n in a.items():
        lcm[p] = max(lcm[p], n)

lcm_val = 1
for p, n in lcm.items():
    lcm_val *= pow(p, n, mod)

ans = 0
for a in A:
    ans += lcm_val * pow(a, mod-2, mod)
    ans %= mod

print(ans)

### FIXED CODE ###

import fractions
from functools import reduce

N = int(input())
A = list(map(int, input().split()))

p = 10**9+7

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(A)

B = [lcm//i for i in A]

print(sum(B)%p)
i = input()
i = i.split(" ")
n = int(i[0])
y = int(i[1])
y = y / 1000

for c in range(int(((y-n) // 9))+1):
  if (int((y-n-9*c)) % 4) == 0:
    cn = [int((y-n-9*c) / 4), c]
    break
  else:
    pass
  
if(len(cn) == 0):
  rs = [-1, -1, -1]
else:
  a = n - cn[0] - cn[1]
  if a >= 0:
    rs = [a, cn[0], cn[1]]
  else:
    rs = [-1, -1, -1]

print(str(rs[2]) + " " + str(rs[1]) + " " + str(rs[0]))

### FIXED CODE ###

i = input()
i = i.split(" ")
n = int(i[0])
y = int(i[1])
y = y / 1000
cn = []

for c in range(int(((y-n) // 9))+1):
  if (int((y-n-9*c)) % 4) == 0:
    cn.append([int((y-n-9*c) / 4), c])
  else:
    pass

if(len(cn) == 0):
  rs = [-1, -1, -1]
else:
  rs = []
  for j in cn:
    a = n - j[0] - j[1]
    if a >= 0:
      rs = [a, j[0], j[1]]
      break
    else:
      pass
  
  if len(rs) != 3:
    rs = [-1, -1, -1]
  else:
    pass
    
print(str(rs[2]) + " " + str(rs[1]) + " " + str(rs[0]))
x,n = map(int,input().split())

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

min = x
max = x

if n == 0:
    print(x)
else:
    for i in range(10000):

        min -= 1
        max += 1

        if min not in arr:
            print(min)
            break

        if max not in arr:
            print(max)
            break

### FIXED CODE ###

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

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break
def solve(g):
    dp = [-1]*len(g)
    def _solve(f):
        if dp[f] == -1:
            for c in g[f]:
                dp[f] = max(dp[f], 1 + _solve(c))
            dp[f] = max(dp[f], 0)
        return dp[f]
    for f in range(len(g)):
        _solve(f)
    # print(dp)
    return max(dp)

n, m = map(int, input().split())
g = [[] for _ in range(n)]
for _ in range(m):
    f, t = map(int, input().split())
    g[f-1].append(t-1)

print(solve(g))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)

def solve(g):
    dp = [-1]*len(g)
    def _solve(f):
        if dp[f] == -1:
            dp[f] = 0
            for c in g[f]:
                dp[f] = max(dp[f], 1 + _solve(c))
        return dp[f]
    for f in range(len(g)):
        _solve(f)
    # print(dp)
    return max(dp)

n, m = map(int, input().split())
g = [[] for _ in range(n)]
for _ in range(m):
    f, t = map(int, input().split())
    g[f-1].append(t-1)

print(solve(g))
n = int(input())
import random

if n % 2 == 0:
  print(0.5)
else:
  print(n-1/2n)
  

### FIXED CODE ###

n = int(input())
import random
 
print(1-(n//2)/n)
n, m = [int(i) for i in input().split()]
e = [[] for _ in range(n)]
for _ in range(m):
    a, b = [int(i) - 1 for i in input().split()]
    e[a].append(b)
    e[b].append(a)

ok = False
tag = [-1] * n


def dfs(i=0, c=0):
    global ok, tag
    if tag[i] != -1:
        if tag[i] != c:
            ok = True
        return
    tag[i] = c
    for j in e[i]:
        dfs(j, (c + 1) % 2)


dfs()

if ok:
    print(n * (n - 1) // 2 - m)
else:
    s = sum(tag)
    print(s * (n - s) - m)


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)


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


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

ok = False
tag = [-1] * n


def dfs(i=0, c=0, r=-1):
    global ok, tag
    if tag[i] != -1:
        if tag[i] != c:
            ok = True
        return
    tag[i] = c
    for j in e[i]:
        if j == r:
            continue
        dfs(j, (c + 1) % 2, i)


dfs()

if ok:
    print(n * (n - 1) // 2 - m)
else:
    s = sum(tag)
    print(s * (n - s) - m)
α = (input())
if α ='A'or'B'or'C'or'D'or'E'or'F'or'G'or'H'or'I'or'J'or'K'or'L'or'M'or'N'or'O'or'P'or'Q'or'R'or'S'or'T'or'U'or'V'or'W'or'X'or'Y'or'Z':
    print('A')
else:
    print('a')


### FIXED CODE ###

α = input()
if α in['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']:
    print('A')
else:
    print('a')
import sys
import numpy as np
def resolve():
    N,M,K = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    Amax_idx = N
    Asum = np.zeros(N+1, dtype = int)
    for i in range(1,N+1):
        Asum[i] = Asum[i-1] + A[i-1]
        if Asum[i] > K:
            Amax_idx = i - 1
            break

    ans = Amax_idx
    ansmax = ans
    anssum = Asum[Amax_idx]
    Acount = 0
    for i in range(M):
        anssum += B[i]
        while anssum > K:
            anssum -= A[Amax_idx - Acount]
            Acount += 1
            if Acount < 0:
                print(ansmax)
                sys.exit()
            ans -= 1
        ans += 1  
        ansmax = max(ansmax,ans)
    print(ansmax)
resolve()

### FIXED CODE ###

def resolve():
    N,M,K = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    Asum, Bsum = [0], [0]
    for i in range(N):
        Asum.append(A[i] + Asum[i])
    for i in range(M):
        Bsum.append(B[i] + Bsum[i])   

    ans = 0
    j = M
    for i in range(N+1):
        if Asum[i] > K:
            break
        while Bsum[j] > K - Asum[i]:
            j-=1         
        ans = max(ans,i+j)
    print(ans)
resolve()
import numpy as np
N = int(input())
queue = [list(map(int, input().split())) for _ in range(N)]


max_N = 100100
prime = np.ones(max_N, dtype=int)
a = np.zeros(max_N, dtype=int)
b = np.zeros(max_N+1, dtype=int)

prime[0], prime[1] = 0, 0
for i in range(2, max_N):
    if i == 0:
        continue
    for j in range(i*2, max_N, i):
        prime[j] = 0

for i in range(1, max_N):
    if i % 2 == 0:
        continue
    if prime[i] == 1 and prime[int((i + 1) / 2)] == 1:
        a[i] = 1
for i in range(0, max_N):
    b[i + 1] = a[i] + b[i]

for i in queue:
    print(b[i[1]+1]-b[i[0]])


### FIXED CODE ###

import numpy as np
N = int(input())
queue = [list(map(int, input().split())) for _ in range(N)]


max_N = 100100
prime = list(np.ones(max_N, dtype=int))
a = list(np.zeros(max_N, dtype=int))
b = list(np.zeros(max_N+1, dtype=int))

prime[0], prime[1] = 0, 0
for i in range(2, max_N):
    if i == 0:
        continue
    for j in range(i*2, max_N, i):
        prime[j] = 0

for i in range(1, max_N):
    if i % 2 == 0:
        continue
    if prime[i] == 1 and prime[int((i + 1) / 2)] == 1:
        a[i] = 1
for i in range(0, max_N):
    b[i + 1] = a[i] + b[i]

for i in queue:
    print(b[i[1]+1]-b[i[0]])
n,m = map(int, input().split())
H = list(map(int, input().split()))
s = [[0]]*m
 
for _  in range(m):
    a, b = map(int, input().split())
    s[a-1].append(H[b-1])
    s[b-1].append(H[a-1])
 
c = 0
for j in range(n):
    if H[j] > max(s[j]):
        c+= 1
 
print(c) 

### FIXED CODE ###

s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')
k = int(input('k = '))
a = int(input('a = ')); b = int(input('b = '))

res = False

for i in range(a, b + 1):
    if i % k == 0:
        res = True
        break

if res == True:
    print('OK')
else:
    print('NG')

### FIXED CODE ###

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

flag = False

for i in range(a, b + 1):
    if i % k == 0:
        flag = True
        break

if flag:
    print('OK')
else:
    print('NG')
import math
N=int(input())
arr=[int(a) for a in input().split()]
ans=0
for i in range(N):
   ans=ans+int(math.log2(arr[N]))

print(ans)


### FIXED CODE ###

N=int(input())
arr=[int(a) for a in input().split()]
ans=0
for i in range(N):
   c=0
   while arr[i]%2 ==0:
      arr[i]=arr[i]//2
      c=c+1
   ans=ans+c

print(ans)
n, k = map(int, input().split())
lis = []
for i in range(k*2):
    lis.append(input().split())
lis2 = []
j = 1
while j < k*2:
    for k in lis[j]:
        lis2.append(k)
    j += 2
lis2 = set(lis2)
print(n - len(lis2))

### FIXED CODE ###

n, k = map(int, input().split())
li = []
for x in range(k*2):
    li.append(input().split())
li2 = []
i = 1
while i < k*2:
    for j in li[i]:
        li2.append(j)
    i += 2
li2 = set(li2)
print(n - len(li2))
N = int(input())
A = list(map(int, input().split()))

hats = A[:]
import copy
from collections import defaultdict
d = defaultdict(lambda: 0)

for h in hats:
    d[h] += 1

h1 = hats[0]
 
def search(now1, now2, count, d):
    now1, now2 = now2, now1^now2
    if d[now2] > 0:
        if count == N:
            return True
        else:
            d[now1] -= 1
            return search(now1, now2, count+1, d)
    else:
        return False
    

ans = False
for h2 in hats[1:]:
    if search(h1, h2, 2, copy.copy(d)):
        ans = True

if ans:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

hats = A[:]
import copy
from collections import defaultdict
d = defaultdict(lambda: 0)

for h in hats:
    d[h] += 1

def f():
    if len(d) == 3:
        xor = 0
        for key in d:
            xor ^= key
        if xor == 0:
            lsit_d = list(d.keys())
            if d[lsit_d [0]] == d[lsit_d [1]] and d[lsit_d [0]] == d[lsit_d [2]]:
                return 'Yes'
            else:
                return 'No'
        else:
            return 'No'

    if len(d) == 1:
        lsit_d = list(d.keys())
        if lsit_d [0] == 0:
            return 'Yes'
        
    if len(d) == 2:
        if d[0] * 2 == N - d[0]:
            return 'Yes'
    
    return 'No'
    
print(f())
import numpy as np

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

ret = 0
def back(X, Y):
    if X == 0 and Y == 0:
        global ret
        ret += 1
        return 0
    elif X>0 and Y > 0:
        back(X-1, Y-2)
        back(X-2, Y-1)
    else:
        return 0

back(X,Y)
print(ret%(10**9+7))

### FIXED CODE ###

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

mod = 10**9+7

def cmb(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

if X>0 and Y>0 and (2*X - Y)%3 == 0 and (2*Y - X)% 3==0 and 2*Y >= X and Y <= 2*X: 
    m = int((2*X - Y)/ 3)
    n = int((2*Y - X)/ 3)
    
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    for i in range( 2, m+n + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )
    ret = cmb(m+n, m, mod)
else:
    ret = 0
print(ret)
S = map(int,input().split("/"))
if S<=20190430:
    print("Heisei")
    elif:
        print("TBD")

### FIXED CODE ###

S = input().split("/")
x = "".join(S)
if int(x)<=20190430:
    print("Heisei")
else:
        print("TBD")
import sys

def remove_bit(num, i):
    high = (num >> (i + 1)) << i
    low = num & ((1 << i) - 1)
    return high + low

def insert_bit(num1, num2, i):
    high = num1 >> i << (i + 1)
    low = num1 & (-1 + (1 << i))
    insert = num2 & (1 << i)
    return high + insert + low

def solve(N, A, B):
    if N == 1:
        return [A, B]

    r_bit = -1
    for i in range(N):
        if (A >> i) & 1 != (B >> i) & 1:
            r_bit = i
            break
    if r_bit == -1:
        import pdb; pdb.set_trace()

    AA = remove_bit(A, r_bit)
    BB = remove_bit(B, r_bit)

    for i in range(N-1):
        if (AA >> i) & 1 == (BB >i) &1:
            C = (AA & (-1 - (1<<i))) + (~AA & (1 << i))
            break
    A_list = solve(N - 1, AA, C)
    B_list = solve(N - 1, C, BB)

    A_list = list(map(lambda x: insert_bit(x, A, r_bit), A_list))
    B_list = list(map(lambda x: insert_bit(x, B, r_bit), B_list))

    return A_list + B_list


def main(N, A, B):
    if (bin(A).count('1') + bin(B).count('1')) % 2 == 0:
        print('NO')
        sys.exit()

    print('YES')
    ans_list = solve(N, A, B)

    assert A == ans_list[0]
    assert B == ans_list[-1]
    for i in range(len(ans_list) - 1):
        assert bin(ans_list[i] ^ ans_list[i+1]).count('1') == 1

    for num in ans_list:
        sys.stdout.write('%d '%num)
    print()



if __name__ == '__main__':
    N, A, B = map(int, input().split())
    main(N, A, B)


### FIXED CODE ###

import sys

def remove_bit(num, i):
    high = (num >> (i + 1)) << i
    low = num & ((1 << i) - 1)
    return high + low

def insert_bit(num1, num2, i):
    high = num1 >> i << (i + 1)
    low = num1 & (-1 + (1 << i))
    insert = num2 & (1 << i)
    return high + insert + low

def solve(N, A, B):
    if N == 1:
        return [A, B]

    r_bit = -1
    for i in range(N):
        if (A >> i) & 1 != (B >> i) & 1:
            r_bit = i
            break
    if r_bit == -1:
        import pdb; pdb.set_trace()

    AA = remove_bit(A, r_bit)
    BB = remove_bit(B, r_bit)

    C = -1
    for C in range(2**(N-1)):
        if bin(AA ^ C).count('1') % 2 == 1 and  bin(AA ^ C).count('1') % 2 == 1:
            break
    A_list = solve(N - 1, AA, C)
    B_list = solve(N - 1, C, BB)

    A_list = list(map(lambda x: insert_bit(x, A, r_bit), A_list))
    B_list = list(map(lambda x: insert_bit(x, B, r_bit), B_list))

    return A_list + B_list


def main(N, A, B):
    if (bin(A).count('1') + bin(B).count('1')) % 2 == 0:
        print('NO')
        sys.exit()

    print('YES')
    ans_list = solve(N, A, B)

    assert A == ans_list[0]
    assert B == ans_list[-1]
    for i in range(len(ans_list) - 1):
        assert bin(ans_list[i] ^ ans_list[i+1]).count('1') == 1

    for num in ans_list:
        sys.stdout.write('%d '%num)
    print()



if __name__ == '__main__':
    N, A, B = map(int, input().split())
    main(N, A, B)
n = int(input())
w = list(map(int,input(),split()))
ans = 1000000000
for t in range(1, n):
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
        

### FIXED CODE ###

P,Q,R =map(int,input().split())
print(P+Q+R-max(P,Q,R))
def gcd(a, b):
    if b == 0:
        return a
    
    return gcd(b, a % b)

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

N = int(input())
T = []

for i in range(N):
    t = int(input())
    T.append(t)
    
ans = 1
for i in range(N):
    ans = lcm(ans, T[i])
    
print(ans)

### 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)

N = int(input())
T = []

for i in range(N):
    t = int(input())
    T.append(t)
    
ans = 1
for i in range(N):
    ans = lcm(ans, T[i])
    
print(ans)
n = int(input())
xs = [int(c) for c in input().split()]
ys = [int(c) for c in input().split()]

def dp(x, y, mods):
  table = [False] * (x + 1)
  table[x] = True
  mods.sort(reverse=True)
  for mod in mods:
    for i in range(x + 1):
      table[i % mod] = table[i % mod] or table[i]
  return table[y]

def ok(mods):
  return all(dp(x, y, list(mods)) for x, y in zip(xs, ys))

if not ok(range(1, 51)):
  print(-1)
  quit(0)

mods = []
for mod in range(50, 0, -1):
  if not ok(mods + list(range(1, mod))):
    mods.append(mod)

print(sum(2 ** mod for mod in mods))

### FIXED CODE ###

n = int(input())
xs = [int(c) for c in input().split()]
ys = [int(c) for c in input().split()]

def dp(x, y, mods):
  if y > x:
    return False
  table = [False] * (x + 1)
  table[x] = True
  mods.sort(reverse=True)
  for mod in mods:
    for i in range(x + 1):
      table[i % mod] = table[i % mod] or table[i]
  return table[y]

def ok(mods):
  return all(dp(x, y, list(mods)) for x, y in zip(xs, ys))

if not ok(range(1, 51)):
  print(-1)
  quit(0)

mods = []
for mod in range(50, 0, -1):
  if not ok(mods + list(range(1, mod))):
    mods.append(mod)

print(sum(2 ** mod for mod in mods))