peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
if N < 1000 :
    print("ABC")
else :
    print("ABD")
# Judge status: Wrong Answer
n = int(input())
L = [2,1]
for i in range(n-1):
    tmp = L[i] + L[i+1]
    L.append(tmp)
print(max(L))
# Judge status: Accepted
x, k, d = map(int, input().split())
x = abs(x)

MIN = x-k*d


if 0 <= MIN:
    print(MIN)
else:
    a, R = divmod(x, d)
    L = d-R
    cnt = k-a
    if cnt % 2 == 0:
        print(R)
    else:
        print(L)
# Judge status: Wrong Answer
def main():
  s = input()
  if s == 'abc' or s == 'bca' or s == 'cab':
    print('Yes')
  else:
    print('No')

if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
A,B = map(int,input().split())
print(A+B % 24)
# Judge status: Wrong Answer
n, k = map(int,input().split())
a = list(map(int, input().split()))

s = 1
d = 1
last = 0
for i in range(n):
    s *= a[i]
    if i - k >= 0:
        d*=a[i-k]
        s = s % 1000000007
        d = d % 1000000007
    num = s // d

    #print(f'{num} {last}')
    if i-1 >= k-1:
        if last >= num:
            print('No')
        else:
            print('Yes')
    last = num
# Judge status: Accepted
from functools import reduce
import sys
from operator import xor


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return map(int, sys.stdin.readline().strip().split())


def main():
    _ = _i()
    a = list(_ia())
    s = reduce(xor, a, 0)
    return " ".join(map(str, map(lambda x: s ^ x, a)))


if __name__ == "__main__":
    print(main())
# Judge status: Wrong Answer
def resolve():
    s = str(input())
    t = str(input())
    if t[:len(s)] == s and len(t) == (len(s) + 1) and len(t) <= 10:
        print('Yes')

    else:
        print('No')


resolve()
# Judge status: Wrong Answer
a = list(map(int, input().split()))
num = int(input())
k = 0
for i in range(num):    #num回２倍を繰り返す。でなければNoをprint
  if a[2] < max(a):   #リストaの中のmaxよりも青が小さいならば青を二倍する
    a[2] = a[2] * 2
    k += 1
  elif a[1] < max(a) and k <num:
    a[1] = a[1] * 2
    k += 1
if a[0] < a[1] and a[1] < a[2]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
W, a, b = map(int, input().split())
if a <= b:
    print(max(0, b - (a + W)))
else:
    print(max(0, a - (b + W)))
# Judge status: Accepted
A,B = (int(x) for x in input().split())
if(A==1):
    A=14
if(B==1):
    B=14
if(A > B):
    print("Alice")
elif(A < B):
    print("Bob")
else:
    print("Draw")
# Judge status: Accepted
c = []
for i in range(3):
    x,y,z = map(int,input().split())
    c.append([x,y,z])

if (c[1][0]-c[0][0] == c[1][1]-c[0][1] == c[1][2]-c[0][2]) and (c[2][0]-c[0][0] == c[2][1]-c[0][1] == c[2][2]-c[0][2]):
    print('Yes')

else:
    print('No')
# Judge status: Wrong Answer
W, H, N = map(int, input().split())
X_Y_A = [map(int, input().split()) for _ in range(N)]
oX = 0
oY = 0
for x, y, a in X_Y_A:
    if a == 1:
        oX = max(x, oX)
    elif a == 2:
        W = min(x, W)
    elif a == 3:
        oY = max(y, oY)
    else:
        H = min(y, H)
A = (W-oX)*(H-oY)
print(A) if A > 0 else print(0)
# Judge status: Wrong Answer
N = int(input())
s_li = []
keys = []
ans = ''
for i in range(N):
    s = input()
    if i == 0:
        keys = set(s)
    else:
        keys = set(s) & keys
    s_li.append(s)
for k in keys:
    min_k = 50
    for s in s_li:
        min_k = min(s.count(k), min_k)
    ans += k * min_k
print(ans)
# Judge status: Accepted
import math
N = int(input())

print(math.ceil(N/2))
# Judge status: Wrong Answer
s = input()
n = int(input())

for _ in range(n):
  q = input().split()
  if q[0] == "1":
    s = s[-1] + s[1:-1] + s[0]
  else:
    if q[1] == "1":
      s = q[2] + s
    else:
      s += q[2]
print(s)
# Judge status: Wrong Answer
from bisect import bisect_left,bisect
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]
A.sort()
for b,c in BC:
  i = bisect_left(A,c)
  if c <= A[0]:
    continue
  if b < i:
    A[:b] = [c]*b
  else:
    A[:i] = [c]*i
print(sum(A))
# Judge status: Wrong Answer
N = int(input())
ans = 0
for i in range(10000):
    if i**2 > N:
        print(ans)
        exit
    ans = i**2
print(ans)
# Judge status: Wrong Answer
ACGT = ['A', 'C', 'G', 'T']
def ok(S):
    for c in S:
        if c not in ACGT:
            return False
    return True
def main():
    S = input()
    res = ''
    for i in range(len(S)-1):
        for j in range(1, len(S)):
            ps = S[i:j]
            if ok(ps) and len(ps) > len(res):
                res = ps

    print(len(res))
    

main()
# Judge status: Accepted
n,m = map(int,input().split())
ans = [0]*n
for _ in range(m):
    a,b = map(int,input().split())
    ans[a-1] += 1
    ans[b-1] += 1
for i in range(n):
    print(ans[i])
# Judge status: Accepted
def calc(x) -> int:
  sum = 0
  while x//10!=0:
    sum += x%10
    x = x//10
  sum+=x
  return sum


n = int(input())
best_score = float('inf')
for a in range(1,n):
  b = n-a
  score = calc(a)+calc(b)
  if score < best_score:
    best_score = score
print(best_score)
# Judge status: Accepted
X = int(input())
if X == 0:
    print(1)
else:
    print(0)
# Judge status: Accepted
def resolve():
    K = int(input())
    S = input()
    print(S if len(S) <= K else S[:K]+"...")

if '__main__' == __name__:
    resolve()
# Judge status: Accepted
from collections import defaultdict

S = input()
N = len(S)
dp = [0 for _ in range(N+1)]

MOD = 2019

dp[-1] = int(S[-1])
tmp = 10
for i in range(N-1, 0, -1):
    m = int(S[i-1])
    dp[i] = (dp[i+1]+tmp*m)%MOD
    tmp = tmp*10%MOD

d = defaultdict(int)

for i in range(N+1):
    d[dp[i]] += 1

ans = 0
for k in d.keys():
    ans += d[k]*(d[k]-1)//2

print(ans)
# Judge status: Accepted
from collections import Counter
from itertools import combinations
s = input()
sc = Counter(s)
if len(sc.keys()) == 1:
    if len(s) == 1:
        print('YES')
    else:
        print('NO')
elif len(sc.keys()) == 2:
    if len(s) == 2:
        print('YES')
    else:
        print('NO')
else:
    ans = 'YES'
    for i,j in combinations(sc.values(),2):
        if abs(i-j) > 1:
            ans = 'NO'
            break
    print(ans)
# Judge status: Accepted
N = int(input())
A = int(input())

if N % 500 <= A:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
H1,M1,H2,M2,K = map(int,input().split())

print(60*(H2-H1)+M2-M1-K)
# Judge status: Accepted
N = int(input())
A = []
B = []
for i in range(N):
    x,y = map(int,input().split())
    A.append(x+y)
    B.append(x-y)

a = max(A)
b = min(A)
c = max(B)
d = min(B)

ans = max(a-b,c-d)
print(ans)
# Judge status: Wrong Answer
l, r = map(int, input().split())

l2 = l // 2019
r2 = r // 2019

if l2 != r2:
  print(0)
else:
  ans=2019
  for i in range(l2, r2):
    for j in range(i+1, r2 + 1):
      ans = min(ans, (i * j)  % 2019)
  print(l * (l + 1) % 2019)
# Judge status: Accepted
a, b, x = map(int, input().split())
a = (a - 1) // x
b = b // x
print(b - a)
# Judge status: Wrong Answer
X,N = map(int,input().split())
p = list(map(int, input().split()))
num=list(range(-100,101))
for i in range(N):
    num.remove(p[i])
min_=210
for i in range(len(num)):
    s=abs(X-num[i])
    if s<min_:
        min_=s
        min_list=[num[i]]
    elif s==min_:
        min_list.append(num[i])
print(min(min_list))
# Judge status: Wrong Answer
N, X, T = map(int,input().split())
if N/X !=0:
	(N//X+1)*T
else:
	(N/X)*T
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = sum(a)
for i in range(n):
    if a[i]<=b[i]:
        a[i], b[i] = 0, b[i]-a[i]
        a[i+1] -= b[i]
    else:
        a[i] -= b[i]
print(x-sum(a))
# Judge status: Accepted
string=['a','b','c','d','e','f','g','h','i','j']
N=int(input())
res=[]
def dfs(ss):
  if len(ss)==N:
    ss=''.join(ss)
    res.append(ss)
  else:
    for i in range(string.index(max(ss))+2):
      a=ss+[string[i]]
      dfs(a)
  return res
ans=dfs(['a'])
for i in range(len(ans)):
  print(ans[i])
# Judge status: Accepted
l,r,d = map(int, input().split())

ans = 0
for i in range(l,r+1):
  if i%d == 0: ans += 1
print(ans)
# Judge status: Wrong Answer

n = int(input().strip())
l = []

for i in range(n):
    x, y = map(int, input().split())
    a = y + x
    b = y - x
    l.append([x, y, a, b])

la = sorted(l, key=lambda z: z[2])
lb = sorted(l, key=lambda z: z[3])

print(max(abs(la[0][0] - la[-1][0]) + abs(la[0][1]-la[-1][1]),
          abs(lb[0][0] - lb[-1][0]) + abs(la[0][1]-la[-1][1])
          )
      )
# Judge status: Accepted
A, B, C = map(int, input().split())
for i in range(1, B+1):
    if (A * i) % B == C:
        print("YES")
        break
else:
    print("NO")
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split())) 
B = list(map(int, input().split())) 

a, b = [0], [0]

for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M

for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K-a[i]:
        j -= 1
    ans = max(ans, i+j)
     
print(ans)
# Judge status: Accepted
S = int(input())
dp = [0 for _ in range(S+1)]
dp[0] = 1
MOD = 10**9+7
for i in range(3,S+1):
    dp[i] = dp[i-1]+dp[i-3]

print(dp[S]%MOD)
# Judge status: Accepted
from collections import Counter

N, *A = map(int, open(0).read().split())
cnt = Counter(A)
ans = 0
for k, v in cnt.items():
    if k > v:
        ans += v
    else:
        ans += v - k
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
if (a+b)>=c:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
y,m,d = map(int, input().split("/"))

if y < 2019:
    print ("Heisei")
    exit ()

if y == 2019:
    if m < 4:
        print ("Heisei")
        exit ()
    elif m == 4:
        if d <= 30:
            print ("Heisei")
            exit ()
    else:
        pass

print ("TBD")
# Judge status: Wrong Answer
n = int(input())

ans = 0
yakusu = 0

for i in range(1,n+1):
    if n % i == 0:
        yakusu += 1
    if yakusu == 8:
        ans += 1

print(ans)
# Judge status: Wrong Answer
import math

def main(r):
  return math.pi * r ** 2
# Judge status: Wrong Answer
from sys import stdin

n = int(stdin.readline().rstrip())
w = [int(x) for x in stdin.readline().rstrip().split()]

ave = sum(w)/len(w)
w1 = [w.pop(0)]
while sum(w1)/len(w1) < ave:
    w1.append(w.pop(0))

print(abs(sum(w1) - sum(w)))
# Judge status: Accepted
N = int(input())
v = list(map(int, input().split()))
v.sort()
A=v[0]
for i in range(N-1):
    A = (A+v[i+1])/2
print(A)
# Judge status: Accepted
from collections import  Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
c = Counter(a)

stay = 0
for k,v in c.most_common(k):
    stay += v
print(n-stay)
# Judge status: Accepted
from bisect import bisect_right,bisect_left
n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
  na=bisect_left(a,b[i])
  nc=bisect_right(c,b[i])
  ans+=na*(n-nc)
print(ans)
# Judge status: Accepted
import math

N = int(input())
tmp = math.ceil(N / 1000)

print(1000*tmp - N)
# Judge status: Accepted
y=x=int(input())
while y%360:y+=x
print(y//x)
# Judge status: Wrong Answer
import math
n = int(input())
count = 0

def prime_factors(number):
    listp = []
    int_sqrtn = int(math.sqrt(number))
    for prime in range(2, int_sqrtn+1):
        if number % prime == 0:
            listp.append(prime)
            number //= prime

    if number > int_sqrtn:
        listp.append(number)

    return listp

print(len(prime_factors(n)))
# Judge status: Accepted
A,B,K=map(int, input().split())
if A>=K:
    print(A-K,B)
else:
    print(0, max(0, B-(K-A)))
# Judge status: Accepted
import math
R = int(input())
pi = math.pi
print(2*R*pi)
# Judge status: Wrong Answer
s = input(str)

ans = ""
for i in range(len(s)):
  if (s[i] == '0'):
    ans += '0'
  elif (s[i] == '1'):
    ans += '0'
  else:
    if (len(ans) > 0):
      ans = ans[:len(ans)-1]

print(ans)
# Judge status: Accepted
n = int(input())
a = [int(x) for x in input().split()]
q = int(input())
bc=[]
for i in range(q):
    bc.append([int(x) for x in input().split()])

a_cnt=[0]*(10**5+1)

for i in range(len(a)):
	a_cnt[a[i]]+=1

a_goukei=sum(a)

for gyou in range(q):
	a_goukei+=(bc[gyou][1]-bc[gyou][0])*a_cnt[bc[gyou][0]]
	print(a_goukei)
	a_cnt[bc[gyou][1]]+=a_cnt[bc[gyou][0]]
	a_cnt[bc[gyou][0]]=0
# Judge status: Accepted
n = input()
nl = int(n[-1:])

if nl == 2 or nl == 4 or nl == 5 or nl == 7 or nl == 9:
  print('hon')
elif nl == 0 or nl == 1 or nl == 6 or nl == 8:
  print('pon')
else:
  print('bon')
# Judge status: Wrong Answer
A,B = map(int,input().split())

if (A+B)%2 != 0:
    print("IMPOSSIBLE")
else:
    print((A+B)/2)
# Judge status: Accepted
n, m = map(int, input().split())
dp = [-1]*(n+1)
for i in range(m):
    dp[int(input())] = 0
dp[0] = 1
if dp[1] != 0:
    dp[1] = 1
for i in range(2,n+1):
    if dp[i] != 0:
        dp[i] = (dp[i-1]+dp[i-2])%1000000007
print(dp[n])
# Judge status: Accepted
n = int(input())
elem = list(map(int, input().split()))
elem.sort()
ans = sum(elem[n::2])
print(ans)
# Judge status: Wrong Answer
s=input()
if(s[1]=='B'):
  print('ARC')
else:
  print('ARC')
# Judge status: Accepted
n, a, b = map(int, input().split())

if a > b:
    print(0)
elif a < b:
    if n < 2:
        print(0)
    else:
        print((b - a) * (n - 2) + 1)
else:
    print(1)
# Judge status: Accepted
import sys
import copy
N = int(input())
p = [int(x) for x in input().split()]
comp = [i for i in range(1, N+1)]

if p==comp:
    print("YES")
    sys.exit()

for i in range(N-1):
    for j in range(i+1, N):
        tmp = copy.copy(p)
        x = tmp[i]
        tmp[i] = tmp[j]
        tmp[j] = x
        if tmp==comp:
            print("YES")
            sys.exit()

print("NO")
# Judge status: Accepted
N,T =map(int,input().split())
a = 1001
for i in range(N):
  c,t = map(int,input().split())
  if t <= T:
    if c < a:
      a = c
if a == 1001:
  print("TLE")
else:
  print(a)
# Judge status: Accepted
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
s = Counter(s)

maxs = max(s.values())
ss = []
for k, v in s.items():
  if maxs == v:
    ss.append(k)
ss.sort()
for si in ss:
  print(si)
# Judge status: Accepted
n = input()
if "7" in n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b,c=mi()
for i in range(1,b):
    if (b*i + c) % a == 0:
        print("YES")
        exit()
print("NO")
# Judge status: Accepted
n = int(input())
res = 0
for i in range(50001):
  if int(i * 1.08) == n:
    res = i
if res != 0:
  print(res)
else:
  print(':(')
# Judge status: Accepted
try:
	while True:
		s = input().split(" ")
		if len(s)==3:
			a, b, c = map(int, s)
			cab = c-a-b
			ans = "No"
			if 0<cab:
				if a*b*4<cab**2:
					ans = "Yes"
			print(ans)
#			print(a**0.5+b**0.5<c**0.5)
except:
	pass
# Judge status: Accepted
n = int(input())
w = [list(input()) for _ in range(n)]

for i in range(n):
    for j in range(n-i-1):
        if w[i] == w[-j-1]:
            print('No')
            exit()

for i in range(n):
    if i < n-1:
        if w[i][-1] != w[i+1][0]:
            print('No')
            exit()

print('Yes')
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0

for i in range(a,b+1):
    i = str(i)
    if i[1::-1] == i[3:]:
        ans += 1

print(ans)
# Judge status: Wrong Answer
aa, bb = open(0).read().splitlines()

aa = sorted(aa)

bb = sorted(bb, reverse=True)

for a, b in zip(aa, bb):
    if a == b:
        continue
    else:
        if a<b:
            print('Yes')
        else:
            print('No')
        break
if len(aa)<len(bb):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b=(map(int,input().split()))
if a>0 and b>0:
    print('Positive')
elif a<=0 and b>=0:
    print('0')
elif a<0 and b<0:
    x=b-a+1
    if x%2==0:
        print('Positive')
    else:
        print('Negative')
# Judge status: Accepted
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if min(y)<=X:
  print("War")
elif Y<=max(x):
  print("War")
else:
  if max(x)>=min(y):
    print("War")
  else:
    print("No War")
# Judge status: Accepted
x = int(input())

deposit = 100
ans = 0

while deposit < x:
    deposit = int(deposit * 1.01)
    ans += 1

print(ans)
# Judge status: Accepted
n = int(input())
cs = input()
cnt = 0
i = 0
j = n-1
while(1):
  if i >= j:
    break
  if cs[i] == "R":
    i += 1
  if cs[j] == "W":
    j -= 1
  if cs[i] == "W" and cs[j] == "R":
    cnt += 1
    i += 1
    j -= 1
      
print(cnt)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
A, B, C = sorted([A, B, C])

if C % 2 == 0:
    print(0)
else:
    d1, d2 = C // 2, (C // 2) + 1
    print(d1, d2)
    e = A * B
    print(abs(d1 - d2) * e)
# Judge status: Wrong Answer
n = int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
print(A[0])
ans=B[int(A[0])-1]

for i in range(1,n):
    if A[i-1]+1==A[i]:
        ans += B[int(A[i])-1]+C[int(A[i-1])-1]
    else:
        ans += B[int(A[i]-1)]
       
print(ans)
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) for i in range(M)]
# print(N, M)
# print(PY)

foo = {} 
for PYi in PY:
    if foo.get(PYi[0]) is None:
        foo[PYi[0]] = []

    foo[PYi[0]].append(PYi[1])
# print(foo)


for PYi in PY:
    print(PYi)
# Judge status: Accepted
N, A, B, C, D = map(int, input().split())

S = '.' + input() + '#'

# S[A,C],S[B,D]には'##'が存在してはいけない
if '##' in S[A: C + 1] or '##' in S[B: D + 1]:
    print('No')
    exit()

# 追い越さなければいけないとき
# S[B,D]に'...'が存在する必要がある
if D < C:
    if not '...' in S[B - 1 : D + 2]:

        print('No')
        exit()

print('Yes')
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a >= b:
  print(b)
else:
  print(a)
# Judge status: Accepted
ab, bc, ac = map(int,input().split(" "))
print((ab*bc)//2)
# Judge status: Accepted
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n)]
ab.sort()
ans = 0
cnt = 0
for i in ab:
    a, b = i[0], i[1]
    if cnt + b >= m:
        print(ans + (m - cnt) * a)
        exit()
    else:
        ans += a * b
        cnt += b
# Judge status: Accepted
R = list()
L = list()
N = int(input())
R.append(0)
for i in range(N):
    k = int(input())
    L.append(k)
    if k == 0:
        R.append(len(L))
R.append(N)
S = sum(L)
for i in range(len(R) - 1):
    if sum(L[R[i] : R[i + 1]]) % 2 == 1:
        S = S - 1
print(S // 2)
# Judge status: Accepted
S=input()
print('ARC' if S=='ABC' else 'ABC')
# Judge status: Accepted
# https://atcoder.jp/contests/abc046/tasks/abc046_a
a, b, c = map(int, input().split())
print(len(set([a, b, c])))
# Judge status: Accepted
H,W = map(int,input().split())
if H==1:
  print(1)
else:
  if W==1:
    print(1)
  elif W==2:
    print(H)
  else:
    if W%2==0:
      print((W//2)*H)
    else:
      if H%2==0:
        print(((W//2)+1)*(H//2) + (W//2)*(H//2))
      else:
        print(((W//2)+1)*((H//2)+1) + (W//2)*(H//2))
# Judge status: Accepted
from itertools import zip_longest

def solve():
    N = input()
    O = input()
    ans = ''
    for x, y in zip_longest(N, O, fillvalue=''):
        ans += x + y
    print(ans)

if __name__ == "__main__":
    solve()
# Judge status: Accepted
S = input()
K = int(input())

for i in range(K):
    c = S[i]
    if c != '1':
        print(c)
        break
else:
    print(1)
# Judge status: Accepted
x, y, z = map(int, input().split())

print((x-z) // (y+z))
# Judge status: Accepted
def main():
    def fun(n):
        if n % 2 == 0:
            return int(n / 2)
        else:
            return 3 * n + 1

    s = int(input())
    vals = [s]
    while True:
        new_v = fun(vals[-1])
        if new_v in vals:
            print(len(vals) + 1)
            break
        else:
            vals.append(new_v)


if __name__ == '__main__':
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
a = int(input())

l = 1
cur_ret = [[0]]
while l < a:
    new_ret = []
    na = new_ret.append
    for i in cur_ret:
        k = max(i) + 2
        for j in range(k):
            na(i+[j])
    cur_ret = new_ret
    l+=1

def format(x):
    x = list(map(lambda x : chr(x+97),x))
    return "".join(x)

cur_ret = list(map(format,cur_ret))
cur_ret.sort()
for i in cur_ret:
    print(i)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
sa=sum(a)
sb=sum(b)
if sb<sa:
  print("No")
  exit(0)
husoku_a=0
husoku_b=0
for aa,bb in zip(a,b):
  if bb<aa:
    husoku_a+=aa-bb
  elif bb>aa:
    husoku_b+=(bb-aa)//2

if husoku_a<=husoku_b:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
S = input()
Q = int(input())
f = 0
for _ in range(Q):
  a, *b = input().split()
  f += int(a)
  if a == "2":
    if int(b[0]) + f % 2 ==0 :
      S = b[1] + S
    else:
      S += b[1]
print (S if f % 2 == 1 else S[::-1])
# Judge status: Accepted
n, m = map(int,input().split())
PY = []
for _ in range(m):
    PY.append(list(map(int,input().split())))
sortedPY = sorted(PY, key=lambda x: x[1])

d = {}
o = [1]*(n+1)
for i in sortedPY:
    d[(i[0],i[1])] = o[i[0]]
    o[i[0]] += 1

for i in PY:
    print(str(i[0]).zfill(6) + str(d[(i[0],i[1])]).zfill(6))
# Judge status: Wrong Answer
s = str(input())
t = str(input())
A=[]
B=[]
for i in range(len(s)):
    if s[i] ==t[i]:
        A.append(s[i])
    else:
        B.append(t[i])
for j in range(len(A)):
    if A[j] in B:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
N = int(input())
B = list(map(int,input().split()))

# 双対考える
# A1<=B1, A2<= min(B1,B2), A3<=min(B2,B3) ...
A = [B[0]]

for i in range(N-1):
    if i+1 != len(B):
        A.extend([min(B[i],B[i+1])])
    else:
        A.extend([max(B[i-1],B[i])])


print(sum(A))
# Judge status: Wrong Answer
a=[]
a=input().split()
for i in range(0,4):
 if a[i]==0:
  print(i)
 else:
  pass
# Judge status: Accepted
N = int(input())
if N % 2 == 0:
    print(0.5)
else:
    print(((N//2)+1)/N)
# Judge status: Accepted
n,m=map(int,input().split())
xy=[]
for _ in range(m):
  xy.append(list(map(int,input().split())))

ans=1
n0=xy[0][1]
rb=[1]
rb[1:1]=[0]*(n-1)
cb=[1]*n
for i in range(m):
  if rb[xy[i][0]-1]==1:
    rb[xy[i][1]-1]=1
  cb[xy[i][1]-1]+=1
  cb[xy[i][0]-1]-=1
  if cb[xy[i][0]-1]==0:
    rb[xy[i][0]-1]=0

print(sum(rb))
# Judge status: Accepted
n = int(input())
ab =[list(map(int, input().split())) for _ in range(n)]
ab.sort(key = lambda l: l[1])
t = 0
out = 'Yes'
for i in range(n):
  t += ab[i][0]
  if t > ab[i][1]:
    out = 'No'
    break
print(out)
# Judge status: Wrong Answer
#coding:utf-8
x, y, a, b, c = map(int, input().split())
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p[0:x]
q[0:y]

p.extend(q)
p.extend(r)
p.sort(reverse = True)
print(p)

ans = 0

for i in range(x + y):
  ans += p[i]
  
print("{}".format(ans))
# Judge status: Accepted
from math import ceil
s = int(input())
y = ceil(s / (10 ** 9))

x = (10 ** 9) * y - s
print(0, 0, 10 ** 9, 1, x, y)
# Judge status: Accepted
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))
mat = [0]*9
A = A1+A2+A3

for i in range(9):
  if A[i] in S:
    mat[i] = 1
res = 'No'
if sum(mat[0:9:3])==3 or sum(mat[1:9:3])==3 or sum(mat[2:9:3])==3 or sum(mat[0:3])==3 or sum(mat[3:6])==3 or sum(mat[6:9])==3 or sum(mat[0:9:4])==3 or sum(mat[2:7:2])==3:
  res = 'Yes'
print(res)
# Judge status: Wrong Answer
import math
H,W = map(int,input().split())

ans = math.ceil(H * W / 2)

print(ans)
# Judge status: Accepted
a=input()
b=input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
A, B, T = map(int, input().split())

print((T//A)*B)
# Judge status: Accepted
n, m = map(int, input().split())

if n % 2 == 1:
    for i in range(m):
        print(i+1,n-i)
else:
    bd = m // 2
    if m % 2 == 1:
        bd += 1
    for i in range(bd):
        print(i+1, n-i)
    for i in range(bd, m):
        print(i+2, n-i)