Harryxun/stf_run huggingface dataset:
pred = [i for i in input()]
data = [i fpr i in input()]
cnt = 0

for i in range(3):
  if pred[i] == data[i]:
    cnt += 1

print(cnt)

### FIXED CODE ###

pred = [i for i in input()]
data = [i for i in input()]
cnt = 0

for i in range(3):
  if pred[i] == data[i]:
    cnt += 1

print(cnt)
n=input()
v=[]
for i in range(n):
  v.append(input())
v.sort()
s=0
while(len(v)>1):
    v0=v.pop(0)
    v1=v.pop(0)
    v.append((v0+v1)/2)
    v.sort()
print(v[0])

### FIXED CODE ###

n=int(input())
v=list(map(int, input().split()))
v.sort()
s=0
while(len(v)>1):
    v0=v.pop(0)
    v1=v.pop(0)
    v.append((v0+v1)/2)
    v.sort()
print(v[0])
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
chk = []
for i in range(n):
  a,b =  map(int,input().split())
  if a <= m:
    chk.append((-b,a))

from heapq import heapify, heappop, heappush
from operator import itemgetter
chk = sorted(chk,key=itemgetter(1))

s = []
heapify(s)
ans = 0
if chk == []:
  print(0)
  exit()
  
cnt = 1
for i in chk:
  a,b = i
  if b == cnt:
    heappush(s,i)
  if b > cnt:
    if s != []:
      r,t = heappop(s)
      ans -= r
      heappush(s,i)
    cnt += 1

for i in range(m-cnt+1):
  r,t = heappop(s)
  ans -= r
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m = map(int,input().split())
chk = []
for i in range(n):
  a,b =  map(int,input().split())
  if a <= m:
    chk.append((a,b))

from heapq import heappop, heappush
from operator import itemgetter
chk = sorted(chk,key=itemgetter(0),reverse=True)

q = []
ans = 0
for i in range(1, m + 1):
    while chk and chk[-1][0] <= i:
        a,b = chk.pop()
        heappush(q,-b)
    if q:
        ans -= heappop(q)
print(ans)
import numpy as np

N,T,*ABf = map(int, open(0).read().split())
AB = np.array(ABf).reshape(N,2).tolist()
dp = [[0] * 2 for _ in range(6000)]
filled = set([0])
for x in AB:
    temp = set()
    change = []
    for y in filled:
        if y + x[0] <= (T-1) + max(dp[y][1],x[0]):
            if dp[y+x[0]][0] < dp[y][0]+x[1]:
                change.append((y,y+x[0],dp[y][0]+x[1],x[0]))
                temp.add(y+x[0])
    for y in change:
        dp[y[1]][0] = y[2]
        dp[y[1]][1] = max(dp[y[0]][1],y[3])
    filled = filled | temp
print(max(dp)[0])

### FIXED CODE ###

N,T,*ABf = map(int, open(0).read().split())
AB = [ABf[i:i+2] for i in range(0, len(ABf), 2)]
AB.sort()
dp = [[0] * 2 for _ in range(6000)]
filled = set([0])
for x in AB:
    temp = set()
    change = []
    for y in filled:
        if y + x[0] <= (T-1) + max(dp[y][1],x[0]):
            if dp[y+x[0]][0] <= dp[y][0] + x[1]:
                change.append((y,y+x[0],dp[y][0]+x[1],x[0]))
    for y in change:
        if dp[y[1]][0] == y[2]:
            dp[y[1]][1] = y[3]
        else:    
            dp[y[1]][0] = y[2]
            dp[y[1]][1] = y[3]
            temp.add(y[0]+x[0])
    filled = filled | temp
print(max(dp)[0])
import math as m

def is_prime(n): #素数かどうか判定
    if n == 1: return False
    for k in range(2, int(m.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table   

a, b = map(int, input().split())
g = m.gcd(a,b)

tb = divisor(g)

count = 1
for i in tb:
    if is_prime(i):
        count += 1

print(count)

### FIXED CODE ###

import math as m
import fractions as fr

def is_prime(n): #素数かどうか判定
    if n == 1: return False
    for k in range(2, int(m.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table   

a, b = map(int, input().split())
g = fr.gcd(a,b)
tb = divisor(g)

count = 1
for i in tb:
    if is_prime(i):
        count += 1

print(count)
a,b,c = map(int, input().split())
ans1 = max(a+b, a-b)
ans = max(ans1, a * b)
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
print(max(a+b,a-b,a*b))
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
 
def lcm(a, b):
    return a*b*pow(gcd(a,b), M-2, M)
#     return a//gcd(a, b)*b

def lcms(a):
    l = a[0]
    for num in a[1:]:
        l = lcm(l, num)
    return l

l = lcms(a)    
ans = 0
M = 10**9+7
for num in a:
    ans += (l*pow(num, M-2, M))
    ans %= M
print(ans)

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

n = int(input())
a = list(map(int, input().split()))
M = 10**9+7

def factor(n, m=None):
    # mを与えると、高々その素因数まで見て、残りは分解せずにそのまま出力する
    arr = {}
    temp = n
    M = int(-(-n**0.5//1))+1
    if m is not None:
        M = min(m+1, M)
    for i in range(2, M):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr[i] = cnt

    if temp!=1:
        arr[temp] = 1

    if not arr:
        arr[n] = 1

    return arr

ds = [factor(num) for num in a]
D = {}
for d in ds:
    for k,v in d.items():
        if k in D:
            D[k] = max(D[k], v)
        else:
            D[k] = v
l = 1
for k,v in D.items():
    l *= pow(k,v,M)
    l %= M
ans = 0
for num in a:
    ans += (l*pow(num, M-2, M))
    ans %= M
print(ans)
H,W=map(int,input().split())
if H==1 or w==1:
    print(0)
else:
    print(((H+1)//2)*((W+1)//2)+(W//2)*(H//2))


### FIXED CODE ###

H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
else:
    print(((H+1)//2)*((W+1)//2)+(W//2)*(H//2))
N ,M = input().split()
X = list(map(int, input().split()))
X.sort()
#print(X)
ans = 0
div = []
sliceNo = []
for i in range(int(M)-1):
    #print(i)
    div.append(abs(X[i + 1] - X[i]))
div.sort()
#print(div)
for i in range(int(N)-1):
    div.pop()
#print(div)
for i in div:
    ans += i
print(ans)

### FIXED CODE ###

N ,M = input().split()
X = list(map(int, input().split()))
ans = 0
if int(N) >= int(M):
    print(ans)
else:
    X.sort()
    #print(X)
    div = []
    for i in range(int(M)-1):
        #print(i)
        div.append(abs(X[i + 1] - X[i]))
    div.sort()
    #print(div)
    for i in range(int(N)-1):
        div.pop()
    #print(div)
    for i in div:
        ans += i
    print(ans)
N = int(input())
A = list(map(int,input().split()))
cnt = [0 for i in range(60)]
mod = 10 ** 9 + 7

for i in range(60):
    for j in A:
        tmp = format(i, '060b')
        if tmp[j] == "1":
            cnt[j] += 1

ans = 0

lst = [1 for i in range(60)]

for i in range(59):
    lst[58-i] = (lst[59-i] * 2) % mod

for i in range(60):
    ans += (lst[i] * cnt[i] * (N -cnt[i])) % mod
    
ans %= mod

print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
mod = 10 ** 9 + 7
cnt = [0 for _ in range(60)]
for a in A:
    for i in range(60):
        cnt[i] += a & 1
        a >>= 1
cnt = [x * (N - x) % mod for x in cnt]
power = 1
ans = 0
for i in range(60):
    ans += power * cnt[i]
    power *= 2
    power %= mod
ans %= mod
print(ans)
n,m,c=map(int,input().split())
a = [list(map(int,input().split())) for i in range(m)]
c=0
for i in range(n):
  x=0  
  for j in range(m):
    x=a[i+1][j]*a[0][j]
  if x+c>0:
    c+=1
print(c)

### FIXED CODE ###

n,m,c=map(int,input().split())
a=[]
for i in range(n+1):  
  a.append(list(map(int,input().split())) )
y=0
for i in range(n):
  x=0  
  for j in range(m):
    x+=a[i+1][j]*a[0][j]
  if x+c>0:
    y+=1
print(y)
N = int(input())
B_list = list(map(int,input().split()))
A_list = [0 for i in range(N)]

A_list[0] = B_list[0]

for i in range(1,N-1):
    A_list[i] = min(B_list[i],B_list[i-1])

A_list[-1] = B_list[-1]
print(sum(A_list)

### FIXED CODE ###

N = int(input())
B = list(map(int, input().split()))
res = B[0]
for i in range(1, N-1):
    res += min(B[i - 1], B[i])
res += B[-1]
print(res)
a = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n):
    s+=1/a[i]
print(1/s)

### FIXED CODE ###

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


### FIXED CODE ###

a = int(input())
b = int(input())
print(6 - a - b)
n, a = [int(input()) for _ range(2)]
print("Yes"if n%500<=a else"No")

### FIXED CODE ###

n, a = [int(input()) for _ in range(2)]
print("Yes" if n%500<=a else "No")
N,T=map(int,raw_input().split())
mc=9999
for i in range(N):
  c,t=map(int,raw_input().split())
  if t<=T:
    mc=min(mc,c)
print mc==9999?"TLE":mc

### FIXED CODE ###

N,T=map(int,raw_input().split())
mc=9999
for i in range(N):
  c,t=map(int,raw_input().split())
  if t<=T:
    mc=min(mc,c)
print "TLE" if mc==9999 else mc
#d=["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"]
#import numpy as np
#n=int(input())
#import fractions
#S=input()
#import math
#lis=list(map(int,input().split()))

n=int(input())
sp={}
for i in range(n):
    li=input().split()
    li.append(i+1)
    if li[0] not in sp:
        sp[li[0]]=[li]
    else:
        sp[li[0]].append(li)
        sp[li[0]].sort(reverse=True)
items_sorted = sorted(sp.items())
#print(items_sorted)
for i in range(len(items_sorted)):
    for j in range(len(items_sorted[i])):
        print(items_sorted[i][1][j][2])


### FIXED CODE ###

#d=["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"]
#import numpy as np
#n=int(input())
#import fractions
#S=input()
#import math
#lis=list(map(int,input().split()))

n=int(input())
sp={}
for i in range(n):
    li=input().split()
    li.append(i+1)
    li[1]=int(li[1])
    if li[0] not in sp:
        sp[li[0]]=[li]
    else:
        sp[li[0]].append(li)
        sp[li[0]].sort(reverse=True)
items_sorted = sorted(sp.items())
#print(items_sorted)
for i in range(len(items_sorted)):
    for j in range(len(items_sorted[i][1])):
        print(items_sorted[i][1][j][2])
n,d = (int(x) for x in input().split())
t = 2d + 1
     
if n % t == 0:
	ans = n/t
else:
	ans = n/t
    ans = ans + 1

print(ans)

### FIXED CODE ###

n,d=(int(x) for x in input().split())
t = 2 * d + 1
     
if n % t == 0:
    ans = n/t
else:
    ans = n/t
    ans = ans + 1

ans = int(ans)
print(ans)
# import math
# import numpy as np
# import itertools
# import heapq
# =map(int,input().split())
w=int(input())
s=int(input())
if w>=s:
    print('unsafe')
else:
    print('safe')



### FIXED CODE ###

# import math
# import numpy as np
# import itertools
# import heapq
# =map(int,input().split())
s,w=map(int,input().split())
if w>=s:
    print('unsafe')
else:
    print('safe')
n = int(input())
a = sorted(list(map(int, input().split(" "))))
idx = 0
while True:
    removes = []
    v = a[idx]
    for target in a[idx:]:
        if target % v == 0:
            removes.append(target)
    removes.remove(v)
    if removes:
        if removes[0] == v:
            removes.append(v)
        for target in removes:
            a.remove(target)
    if len(a) == 0 or a[-1] == v:
        break
    idx += 1
print(len(a))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split(" ")))
a_max = max(A)
cnts = [0] * (a_max + 1)
for a in A:
    v = a
    while v <= a_max:
        cnts[v] += 1
        v += a
cnt = 0
for a in A:
    if cnts[a] == 1:
        cnt += 1
print(cnt)
N, K = map(int, input().split())
X = list(map(int, input().split()))

x_minus = [a for a in X if a < 0]
x_plus = [a for a in X if a >= 0]

ans = float("inf")
for i in range(K+1):
    if i == 0:
        if len(x_plus) >= K:
            dis = x_plus[K - 1]
            ans = min(ans, dis)
        else:
            continue
    if i != 0:
        if len(x_minus) > i and len(x_plus) >= K - i:
            dis = 2 * abs(x_minus[-i]) + x_plus[K - i - 1]
            ans = min(ans, dis)
            dis = 2 * x_plus[K - i - 1] + abs(x_minus[-i])
            ans = min(ans, dis)
        else:
            continue


print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
X = list(map(int, input().split()))

x_minus = [a for a in X if a < 0]
x_plus = [a for a in X if a >= 0]

ans = float("inf")
for i in range(K+1):
    if i == 0:
        if len(x_plus) >= K:
            dis = x_plus[K - 1]
            ans = min(ans, dis)
        else:
            continue
    elif 1 <= i <= K - 1:
        if len(x_minus) >= i and len(x_plus) >= K - i:
            dis = 2 * abs(x_minus[-i]) + x_plus[K - i - 1]
            ans = min(ans, dis)
            dis = 2 * x_plus[K - i - 1] + abs(x_minus[-i])
            ans = min(ans, dis)
        else:
            continue
    elif i == K:
        if len(x_minus) >= K:
            dis = abs(x_minus[-K])
            ans = min(ans, dis)


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

A=[int(x) for x in input().split()]
B=[int(x) for x in input().split()]

a=0
b=0
ans=0
books=N+M
time=0


while(1):
    if a+b==books or time>=K:
        break
    
    elif (a!=N and b!=M):
        if A[a]>B[b]:
            if time+B[b]<=K:
                time+=B[b]
                b+=1
                ans+=1
            else:
                break
        
        elif B[b]>A[a]:
            if time+A[a]<=K:
                time+=A[a]
                a+=1
                ans+=1
            else:
                break
        
        else:
            if time+A[a]>K:
                break
            else:
                tmpa=a
                tmpb=b
                while(1):
                    tmpa+=1
                    tmpb+=1
                    if A[tmpa]>B[tmpb]:
                        if time+B[b]<=K:
                            time+=B[b]
                            b+=1
                            ans+=1
                            break
                        else:
                            break
                    
                    elif A[tmpa]<B[tmpb]:
                        if time+A[a]<=K:
                            time+=A[a]
                            a+=1
                            ans+=1
                            break
                        else:
                            break
            
    elif a==N and b!=M:
        if time+B[b]<=K:
            time+=B[b]
            b+=1
            ans+=1
        else:
            break
        
    elif b==M and a!=N:
        if time+A[a]<=K:
            time+=A[a]
            a+=1
            ans+=1
        else:
            break
print(ans)
        

### FIXED CODE ###

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

a=[0]
b=[0]

tmp_a=0
tmp_b=0
for i in A:
    tmp_a+=i
    a.append(tmp_a)

for i in B:
    tmp_b+=i
    b.append(tmp_b)
    

ans,j=0,M
for i in range(N+1):#i…A台の本数
    if a[i]>K:
        break
    while(1):
        if b[j]<=(K-a[i]):
            break
        j-=1
    ans=max(ans,i+j)
    
print(ans)
n,m = map(int,input().split())
a = []
b = []
fl = False
for i in range(n):
    a.append(list(input()))
for i in range(m):
    b.append(list(input()))
for i in range(n - m + 1):
    if b[0] in a[i]:
        tmp = a[i].find(b[0])
        if m == 1:
            fl = True
        for j in range(1,m):
            if a[i+j][tmp:tmp+m] != b[j]:
                fl = False
                break
            fl = True
    if fl:
        break
        if fl:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n,m = map(int,input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]
fl = False
for i in range(n - m + 1):
    if b[0] in a[i]:
        tmp = a[i].find(b[0])
        if m == 1:
            fl = True
        for j in range(1,m):
            if a[i+j][tmp:tmp+m] != b[j]:
                fl = False
                break
            fl = True
    if fl:
        break
if fl:
    print("Yes")
else:
    print("No")
def solve():
    n = int(input())
    pattern = [[a, b] for a, b in zip(list(input()), list(input()))]
    pointer, ans = 0, 0
    if pattern[0][0] == pattern[0][1]:
        ans = 3
    else:
        ans = 6
    while pointer < n - 1:
        current = pattern[pointer][0]
        if current == pattern[pointer][1]:
            if pattern[pointer+1][0] == pattern[pointer+1][1]:
                ans *= 2
                # print("X->X")
            else:
                ans *= 2
                # print("X->Y")
            pointer += 1
        else:
            if pattern[pointer+2][0] == pattern[pointer+2][1]:
                ans *= 1
                # print("Y->X")
            else:
                ans *= 3
                # print("Y->Y")
            pointer += 2
    print(ans % 1000000007)

if __name__=="__main__":
    solve()


### FIXED CODE ###

def solve():
    n = int(input())
    pattern = [[a, b] for a, b in zip(list(input()), list(input()))]
    pointer, ans = 0, 0
    if pattern[0][0] == pattern[0][1]:
        ans = 3
    else:
        ans = 6
    while pointer < n - 1:
        current = pattern[pointer][0]
        if current == pattern[pointer][1]:
            if pattern[pointer+1][0] == pattern[pointer+1][1]:
                ans *= 2
                # print("X->X")
            else:
                ans *= 2
                # print("X->Y")
            pointer += 1
        else:
            if pointer + 2 >= n - 1:
                break
            if pattern[pointer+2][0] == pattern[pointer+2][1]:
                ans *= 1
                # print("Y->X")
            else:
                ans *= 3
                # print("Y->Y")
            pointer += 2
    print(ans % 1000000007)

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

### FIXED CODE ###

a,b=map(int,input().split())
if a<=5:
   print(0)
elif a<=12:
   print(b//2)
else:
   print(b)
import math
while t == 0:	
	try:
		n = int(raw_input().split())
	except:
		break
	else:
		print(math.log10(int(n[0]) + int(n[1])) + 1)

### FIXED CODE ###

import math
t = 0
while t == 0:	
	try:
		x,y=[int(i) for i in input().split()]
	except:
		break
	else:
		a = int (math.log10(x + y) + 1)
		print(a)
import sys
sys.setrecursionlimit(10**7)

def warshall_floyd(d):
    n = len(d)
    for i in range(n):
        for j in range(n):
            for k in range(n):
                d[j][k] = min(d[j][k], d[j][i] + d[i][k])
    return d

def main():
    input = sys.stdin.readline
    N = int(input())
    G = []
    for _ in range(N):
        S = [int(c) for c in str(input().strip())]
        T = []
        for i, e in enumerate(S):
            if e == 1:
                T.append(i)
        G.append(T)
    
    def is_binarygraph(v, color):
        colors = [-1] * N
        colors[v] = color
        for n in G[v]:
            if colors[n] == color:
                return False
            colors[n] = (color + 1) % 2
            if not is_binarygraph(n, (color+1)%2):
                return False
        return True
    
    if not is_binarygraph(0, 0):
        return -1

    inf = 10**3
    d = [[inf]*N for _ in range(N)]
    for i in range(N):
        for j in range(G[i]):
            d[i][j] = 1
    
    fw = warshall_floyd(d)
    return max(fw)

if __name__ == '__main__':
    print(main())

### FIXED CODE ###

import sys
import numpy as np
from scipy.sparse.csgraph import floyd_warshall
sys.setrecursionlimit(10**7)


def main():
    input = sys.stdin.readline
    N = int(input())
    G = []
    for _ in range(N):
        S = [int(c) for c in str(input().strip())]
        T = []
        for i, e in enumerate(S):
            if e == 1:
                T.append(i)
        G.append(T)
    
    colors = [-1] * N
    visited = [False] * N
    def is_binarygraph(v, color):
        visited[v] = True
        for n in G[v]:
            if colors[n] == color:
                return False
            if visited[n]:
                continue
            colors[n] = (color + 1) % 2
            if not is_binarygraph(n, colors[n]):
                return False
        return True
    
    colors[0] = 0
    if not is_binarygraph(0, 0):
        return -1

    inf = 10**3
    d = [[inf]*N for _ in range(N)]
    for i in range(N):
        for j in G[i]:
            d[i][j] = 1
    for i in range(N):
        d[i][i] = 0
    
    fw = floyd_warshall(d)
    return np.max(fw) + 1

if __name__ == '__main__':
    print(int(main()))
A = int(input())
B = int(input())
H = int(input())
print((A+b)*H//2)

### FIXED CODE ###

A = int(input())
B = int(input())
H = int(input())
print((A+B)*H//2)
n = input()
data = []
a = []
for i in ['D', 'C', 'H', 'S']:
    for j in map( str , xrange(1, 14)):
        data.append(i + j)   
for i in xrange(n):
    data.remove(raw_input())
for i in xrange(len(data)):
    print data[i]

### FIXED CODE ###

n = input()
data = []
space = []
for i in ['S ', 'H ', 'C ', 'D ']:
    for j in map( str , xrange(1, 14)):
        data.append(i + j)   
for i in xrange(n):
    data.remove(raw_input())
for i in xrange(len(data)):
    print data[i]
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
while sum1%10==0:
    sum1 -= L[i]
    i +=1
print(sum1)

### FIXED CODE ###

n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
li.sort()
flag1 = False
flag2 = False
flag3 = False
if sum(li)%10 != 0:
    flag2 = True

for i in range(n):
    if (sum(li) - li[i])%10 != 0 and flag2 == False:
        flag1 = True
        break
    else:
        flag3 =True
    
if flag1:
    print (sum(li) - li[i])
elif flag2:   
    print(sum(li))
elif flag3:
    print(0)
n,a,b=input().split()
nn=[0]*4
x=0
for i in range(1,n+1,1,):
    nn=len(i)
    y=nn[0]+nn[1]+nn[2]+nn[3]
    if (y>=a)and(y<=b):
        x=x+y
print(x)

### FIXED CODE ###

n=list(map(int,input().split()))
l=n[0]+n[1]
r=n[2]+n[3]
if l>r:
    print('Left')
elif l==r:
    print('Balanced')
else:
    print('Right')
n=raw_input()
A=map(int,raw_input.split())
q=raw_input()
m=map(int,raw_input.split())

def solve(c, m)
  if m == 0:
    return true
  if c >= n or sum(A)<m:
    return false
  res = solve(c + 1, m) || solve(c + 1, m - A[c])
  return res

for i range(0,q):
  if solve(0,m[i])==1:
    print yes
  else:
    print no

### FIXED CODE ###

n=int(raw_input())
A=map(int, raw_input().split())
q=int(raw_input())
m=map(int, raw_input().split())

def solve(j, m):
  if m == 0:
    return 1
  if j >= n or m > sum(A):
    return 0
  res = solve(j + 1, m) or solve(j + 1, m - A[j])
  return res

for i in range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"
import math
A,B,C,D = list(map(int,input().split()))
dis = B - A + 1

CD = C*D//math.gcd(C,D)
#print(CD)
perCfromA = (A-1)//C
perDfromA = (A-1)//D
perCDfromA = (A-1)//(CD)


perCfromB = B//C
perDfromB = B//D
perCDfromB = B//(CD)

#print(perCfromA,perDfromA,perCDfromA,perCfromB,perDfromB,perCDfromB)
warikire = (perCfromB + perDfromB -perCDfromB) - (perCfromA + perDfromA -perCDfromA)
warikirenai = dis -warikire
print(warikirenai)

### FIXED CODE ###

import fractions
A,B,C,D = list(map(int,input().split()))
dis = B - A + 1

CD = C*D//(fractions.gcd(C,D))
#print(CD)
perCfromA = (A-1)//C
perDfromA = (A-1)//D
perCDfromA = (A-1)//(CD)


perCfromB = B//C
perDfromB = B//D
perCDfromB = B//(CD)

#print(perCfromA,perDfromA,perCDfromA,perCfromB,perDfromB,perCDfromB)
warikire = (perCfromB + perDfromB -perCDfromB) - (perCfromA + perDfromA -perCDfromA)
warikirenai = dis -warikire
print(warikirenai)
import math

x1,y1,x2,y2 = input().split()

print(math.sqrt((x2-x1)**2 + (y2-y1)**2))

### FIXED CODE ###

import math

x1,y1,x2,y2 = map(float,input().split())

print(math.sqrt((x2-x1)**2 + (y2-y1)**2))
a = int(input())
line = [i for i in a if i]
b = line[0]
for i in line:
  if i != b:
    return print("No")
print("Yes")

### FIXED CODE ###


line = [int(i) for i in input().split(" ")]
b = line[0]
flag = 0
for i in line:
    if i != b:
        flag = 1
if flag == 1:
    print("No")
else:
    print("Yes")