Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
import math
A, B, C, D = map(int, input().split())
ans = 0
Am = 0
Bm = 0
df = 0

Am = A - (A // C + A // D - A //lcm_base(C,D))
Bm = B - (B // C + B // D - B //lcm_base(C,D))
ans = Bm - Am

if A % C != 0 and A % D != 0:
	ans += 1
print(ans)

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

### FIXED CODE ###

# -*- coding: utf-8 -*-
A, B, C, D = map(int, input().split())
ans = 0
Am = 0
Bm = 0
df = 0
t = 0

def lcm(x, y):
	return (x * y) // gcd(x, y)

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

t = B - A + 1
Am = B // C - (A - 1) // C
Bm = B // D - (A - 1) // D
df = B // lcm(C, D) - (A - 1)//lcm(C, D)
ans = t - (Am + Bm) + df
print(ans)
# D
H, W, N = map(int,input().split())
field_dict = dict()
X_list = [0]*N
Y_list = [0]*N

for i in range(N):
    X, Y = map(int,input().split())
    X_list[i] = X-1
    Y_list[i] = Y-1
    field_dict[(X-1)*1000000 + (Y-1)] = 1

def query(posi_x, posi_y):
    return field_dict.get(posi_x*1000000+posi_y, 0)

# minimam x reachable
reach_y = [W]*H
reach_y[0] = 0
posi_x, posi_y = 0, 0

while posi_x < W - 1:
    # takahashi
    if query(posi_x+1, posi_y) == 1:
        # gameover
        break
    else:
        posi_x += 1
    # aoki
    if query(posi_x, posi_y+1) == 0:
        # move
        posi_y += 1
        reach_y[posi_y] = posi_x
        
res = W

for i in range(N):
    if reach_y[Y_list[i]] < X_list[i]:
        res = min(res, X_list[i])
        
print(res)

### FIXED CODE ###

# D
H, W, N = map(int,input().split())
field_dict = dict()
X_list = [0]*N
Y_list = [0]*N

for i in range(N):
    X, Y = map(int,input().split())
    X_list[i] = X-1
    Y_list[i] = Y-1
    field_dict[(X-1)*1000000 + (Y-1)] = 1

def query(posi_x, posi_y):
    return field_dict.get(posi_x*1000000+posi_y, 0)

# minimam x reachable
reach_y = [H]*W
reach_y[0] = 0
posi_x, posi_y = 0, 0

while posi_x < H - 1:
    # takahashi
    if query(posi_x+1, posi_y) == 1:
        # gameover
        break
    else:
        posi_x += 1
    # aoki
    if query(posi_x, posi_y+1) == 0 and posi_y + 1 < W:
        # move
        posi_y += 1
        reach_y[posi_y] = posi_x
        
res = H

for i in range(N):
    if reach_y[Y_list[i]] < X_list[i]:
        res = min(res, X_list[i])
        
print(res)
n = int(input())
l = map(int, input().split())
print("Yes" if max(l) > sum(l) - max(l) else "No")

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
print("Yes" if max(l) < sum(l) - max(l) else "No")
N = int(input())
graph = [[] for _ in range(N)]

for i in range(N-1):
    u, v, w = map(int, input().split())
    graph[u-1].append((v-1, w))
    graph[v-1].append((u-1, w))
# これによって木が定義できた
# print(graph)

flag = [None for _ in range(N)]  # まだどの頂点も探索していない


def k(v, distance):  # distanceは0or1
    flag[v] = distance  # 最初は0

    for next_v, w in graph[v]:
        if flag[next_v] == 1 or flag[next_v] == 0:  # 到達済み（親）であればcontinue
            continue
        if (w % 2) == 0:  # そのノードへの距離が偶数であればそのまま（最初は0なので）
            k(next_v, distance)
        else:
            k(next_v, 1-distance)


k(0, 0)  # 親を強制的に決めてよい, この場合は0のノードを親にしている
for i in range(N):
    print(int(flag[i]))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
n=int(input())
a=[[] for i in range(n)]
for i in range(n-1):
    u,v,w=map(int,input().split())
    a[u-1].append((v-1,w))
    a[v-1].append((u-1,w))
b=[None for i in range(n)]
def k(v,dis):
    b[v]=dis
    for next_v,w in a[v]:
        if b[next_v]!=None:
            continue
        if w%2==0:
            k(next_v,dis)
        else:
            k(next_v,1-dis)
k(0,0)
for i in range(n):
    print(b[i])
h=int(input())
w=int(input())

print(ceil(h/2.0)*ceil(w/2.0)+floor(h/2.0)*floor(w/2.0))

### FIXED CODE ###

import math
r,c = input().split()
r = int(r)
c = int(c)
if(r==1 or c==1):
    print(1)
else:    
    ans = r*c/2
    if r%2==1 and c%2==1:
        print(math.floor(ans)+1)
    else:
        print(math.floor(ans))
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,input().split()))
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = [26**i for i in range(1,100)]
A = [0]+list(itertools.accumulate(A))
cnt = 0
for i in range(N):
    if A[i] >= N:
        p = cnt
        break
    cnt += 1
if p == 1:
    print(chr(N+96))
    exit()
s = []
if N in A:
    print('z'*p)
    exit()
for i in range(p):
    m = chr(N%26+96)
    if m == '`':
        m = 'a'
    s.append(m)
    N = N//26
s.reverse()
print(''.join(s))

### FIXED CODE ###

import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
S = []
for i in range(1,100):
    if N < 27:
        break
    N -= 1
    S.append(chr(ord('a')+N%26))
    N = N//26
S.append(chr(ord('a')+N-1))
print(''.join(S[::-1]))
N=int(input())
red=sorted(list(map(int,input().split())) for i in range(N), key=lambda x:-1*x[1])
blue=sorted(list(map(int,input().split())) for i in range(N))
red = sorted(red, key = lambda x:x[1] * -1)
count=0
for i in red:
    for n,j in enumerate(blue):
        if i[0]<j[0] and i[1]<j[1]:
            count+=1
            del blue[n]
            break
print(count)

### FIXED CODE ###

N=int(input())
red=sorted([list(map(int,input().split())) for i in range(N)], key=lambda x:-1*x[1])
blue=sorted([list(map(int,input().split())) for i in range(N)])
red = sorted(red, key = lambda x:x[1] * -1)
count=0
for i in red:
    for n,j in enumerate(blue):
        if i[0]<j[0] and i[1]<j[1]:
            count+=1
            del blue[n]
            break
print(count)
print(sum(map(int,input().split())) if sum(map(int,input().split()))<10 else "error")

### FIXED CODE ###

A,B = map(int,input().split())
print(A+B if A+B<10 else "error")
A = input()
A = int(A)
B = input()
B = int(B)

print(A*B)

### FIXED CODE ###

A,B = input().split()
A = int(A)
B = int(B)
print(A*B)
import sys
n = int(input()
ans = n%615
for i in range(7):
    for j in range(7):
        for k in range(7):
            for l in range(7):
                for m in range(7):
                    for n in range(7):
                        tmp = 100*i+101*j + 102*k + 103*l * 104*m + 105*n
                        if ans == tmp:
                            print('1')
                            sys.exit()
                        elif m < tmp:break
print('0')

### FIXED CODE ###

x=int(input())
n=x//100
if x<100:
    print('0')
else:
    if 100*n<=x and 105*n>=x:
        print('1')
    else:
        print('0')
N, M = map(int, input().split())
A, B = [], []
for _ in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)

import numpy as np
dp = np.zeros([N+1, M+1])
    
for i in range(1, N+1):
    for j in range(A[i-1], M+1):
        dp[i][j] = B[i-1]

ans = 0
for j in range(1, M+1):
    i = np.argmax(dp[:, j])
    ans += dp[i, j]
    dp[i, :] = 0
print(int(ans))

### FIXED CODE ###

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB = sorted(AB, key=lambda x: x[0])  # sort by days

import heapq
que = []
heapq.heapify(que)

ans = 0
i = 0
for day in range(1, M+1):
    while i < len(AB) and AB[i][0] <= day:
        heapq.heappush(que, (-1)*AB[i][1])
        i += 1
    if que:
        ans += (-1)*heapq.heappop(que)
print(ans)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
mod = 10 ** 9 + 7

B = ['.'] * (N + 1) 
for a in A:
    B[a] = '#'
    
dp = [0] * (N + 1)
if B[1] == '.' and B[2] == '.':
    dp[1] = 1
    dp[2] = 2
elif B[1] == '#' and B[2] == '.':
    dp[2] = 1
elif B[1] == '.' and B[2] == '#':
    dp[1] = 1
    
for i in range(3, N + 1):
    if B[i] == '.':
        dp[i] = (dp[i - 2] + dp[i - 1]) % mod
    
print(dp[N])

### FIXED CODE ###

import sys
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
mod = 10 ** 9 + 7

if N == 1:
    print(1)
    sys.exit()

B = ['.'] * (N + 1) 
for a in A:
    B[a] = '#'
    
dp = [0] * (N + 1)
if B[1] == '.' and B[2] == '.':
    dp[1] = 1
    dp[2] = 2
elif B[1] == '#' and B[2] == '.':
    dp[2] = 1
elif B[1] == '.' and B[2] == '#':
    dp[1] = 1
    
for i in range(3, N + 1):
    if B[i] == '.':
        dp[i] = (dp[i - 2] + dp[i - 1]) % mod
    
print(dp[N])
import sys
K = int(input())
 
d = pow(9, -1, K)
t = 1
for ans in range(1, K*2):
    #x = 7*(pow(10, ans, K) - 1)*d
    t = (t*10) % K
    x = 7*(t - 1)*d
    if  x%K == 0:
        print(ans)
        sys.exit()
 
print(-1)

### FIXED CODE ###

import sys
K = int(input())

x = 7
for ans in range(1, K*2):

    if  x%K == 0:
        print(ans)
        sys.exit()

    x = (x*10 + 7) % K
print(-1)
N , M = map(int, input())
print(N-M+1)

### FIXED CODE ###

N,M = map(int, input().split())
print(N-M+1)
a=[int(input()) for i in range(3)]
a.sort()
print((a[2]*10)+a[1]+a[0])

### FIXED CODE ###

a,b,c=sorted(map(int,input().split()))
print(10*c+b+a)
n = int(input())
taro, hanako = 0, 0
for number in n:
  taro_string, hanako_string = raw_input().split()
  if taro_string > hanako_string:
    taro += 3
  elif hanako_string > taro_string:
    hanako += 3
  else:
    taro += 1
    hanako += 1
print taro, hanako 

### FIXED CODE ###

n = input()
taro, hanako = 0, 0
for number in range(n):
  taro_string, hanako_string = raw_input().split()
  if taro_string > hanako_string:
    taro += 3
  elif hanako_string > taro_string:
    hanako += 3
  else:
    taro += 1
    hanako += 1
print taro, hanako
n = int(input())

l = list(map(int, input().split()))

sort(l)

m = int(input())

for i in range(m):
    a,b = map(int, input().split())
    
    l = [b if j == a else j for j in l]

    print(sum(l))

### FIXED CODE ###

import collections

n=int(input())
arr=list(map(int,input().split()))
cnt=collections.defaultdict(int)
for val in arr: #あらかじめ各Aiの個数を数えておく
 cnt[val]+=1
sums=sum(arr) #あらかじめAiの総和を求めておく
q=int(input())
for _ in range(q):
 b,c=map(int,input().split())
 diff=(c-b)*(cnt[b]) #各クエリにおいて数列Aの総和は(値がBiである要素の個数)*(Ci-Bi)だけ変化する
 sums+=diff
 print(sums) 
 cnt[c]+=cnt[b] #値がCi,Biである要素の個数を更新する
 cnt[b]=0
b=input()
if b=='A':
  a='T'
elif b=='T':
  a='A':
elif b=='C':
  a='G':
else:
  a='C'
 print(a)

### FIXED CODE ###

b=input()
if b=='A':
    a='T'
elif b=='T':
    a='A'
elif b=='C':
    a='G'
else:
    a='C'
print(a)
from itertools import accumulate
from operator import xor

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

MOD = 10**9 + 7

acc = list(accumulate(A, xor))
M = max(acc)
dp = [[0, 0, 0] for _ in range(M + 1)]
U = set()
z = 0
for x in acc:
    if x == 0:
        z += 1
        for u in U:
            dp[u][1] = (dp[u][1] + dp[u][0]) % MOD
        U = set()
    else:
        if dp[x][2] < z:
            dp[x][1] = ((z - dp[x][2]) * dp[x][1]) % MOD
            dp[x][2] = z
        dp[x][0] = (dp[x][0] + dp[x][1] + 1) % MOD
        U.add(x)
ans = (
    dp[acc[-1]][1] + 1 if acc[-1] != 0 else
    sum(dp[x][0] for x in range(1, M + 1)) + pow(2, acc.count(0) - 1, MOD)
) % MOD

# 出力
print(ans)


### FIXED CODE ###

from itertools import accumulate
from operator import xor

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

MOD = 10**9 + 7

acc = list(accumulate(A, xor))
M = max(acc)
dp = [[0, 0, 0] for _ in range(M + 1)]
z = 0
for x in acc:
    if x == 0:
        z += 1
    else:
        dp[x][1] = (dp[x][1] + (z - dp[x][2]) * dp[x][0]) % MOD
        dp[x][0] = (dp[x][0] + dp[x][1] + 1) % MOD
        dp[x][2] = z
for x in range(1, M + 1):
    dp[x][1] = (dp[x][1] + (z - dp[x][2]) * dp[x][0]) % MOD
ans = (
    dp[acc[-1]][1] + 1 if acc[-1] != 0 else
    sum(dp[x][0] for x in range(1, M + 1)) + pow(2, acc.count(0) - 1, MOD)
) % MOD

# 出力
print(ans)
N,Q = map(int,input().split())

adj = [list() for _ in range(N)]
for _ in range(N-1):
    a,b = map(int,input().split())
    adj[a-1].append(b-1)
memo = [0]*N
for _ in range(Q):
    p,x = map(int,input().split())
    memo[p-1] += x

result = [None]*N
def dfs(v,a):
    c = memo[v]
    for u in adj[v]:
        dfs(u,a+c)
    result[v] = a+c
dfs(0,0)
print(*result)

### FIXED CODE ###

N,Q = map(int,input().split())

adj = [list() for _ in range(N)]
for _ in range(N-1):
    a,b = map(int,input().split())
    adj[a-1].append(b-1)

memo = [0]*N
for _ in range(Q):
    p,x = map(int,input().split())
    memo[p-1] += x

result = [None]*N
stack = [(0,0)]
while stack:
    v,a = stack.pop()
    a += memo[v]
    result[v] = a
    for u in adj[v]:
        stack.append((u,a))

print(*result)
N,K=(int(i) for i in input().split())
S=input()
print(S[:K]+S[K+1].lower()+S[K+1:])

### FIXED CODE ###

N,K=(int(i) for i in input().split())
S=input()
print(S[:K-1]+S[K-1].lower()+S[K:])
A,B,C = map(int, input().split())
if A=B or B=C or C=A:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A,B,C = map(int, input().split())
if A==B==C:
  print('No')
elif A==B or B==C or C==A:
  print('Yes')
else:
  print('No')
n=input()
s=n.split()
a=s[0]
b=s[1]
S=a*b
L=(2*a)+(2*b)
print(S' 'L)


### FIXED CODE ###

#cording; UTF-8
a,b=[int(x) for x in input().split()]

S = a*b
L = 2*(a+b)
print(S,L)
in = list(map(int, input().split()))

print(in[2], in[0], in[1])

### FIXED CODE ###

ina = list(map(int, input().split()))
 
print(ina[2], ina[0], ina[1])
f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")
N = int(f.readline())
A = list(map(int, f.readline().split()))
A.insert(0, 0)

select_num = N//2
inf = -10e+10

Dp_f = [[inf] * (3) for _ in range(N+1)]
Dp_s = [[inf] * (3) for _ in range(N+1)]
# 3　次元はそれぞれStart~3つに該当

pre_margin = 0
for i in range(1,N+1):
    Start = (i-1)//2
    End = (i+1)//2
    
    cur_margin = Start
    
    for j in range(Start,End+1):
        Dp_f[i][j-cur_margin] = max(Dp_s[i-1][j-pre_margin], Dp_f[i-1][j-pre_margin])   
        # [0] in 3rd dimension  not chosen at last num
        # must be transfered from [i-1]
    for j in range(Start,End+1):
        if Dp_f[i-1][j-1-pre_margin] == inf:
            Dp_s[i][j-cur_margin] = 0 + A[i]
        else:
            Dp_s[i][j-cur_margin] = Dp_f[i-1][j-1-pre_margin]+A[i]
            
    pre_margin = cur_margin
print(max(Dp_f[-1][select_num - cur_margin], Dp_s[-1][select_num - cur_margin]))


### FIXED CODE ###


#f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")
N = int(input())
A = list(map(int, input().split()))
A.insert(0, 0)

select_num = N//2
inf = -10e+100

Dp_f = [[inf] * (3) for _ in range(N+1)]
Dp_s = [[inf] * (3) for _ in range(N+1)]
# 3　次元はそれぞれStart~3つに該当

pre_margin = 0
for i in range(1,N+1):
    Start = (i-1)//2
    End = (i+1)//2
    
    cur_margin = Start
    
    for j in range(Start,End+1):
        Dp_f[i][j-cur_margin] = max(Dp_s[i-1][j-pre_margin], Dp_f[i-1][j-pre_margin])   
        # [0] in 3rd dimension  not chosen at last num
        # must be transfered from [i-1]
    for j in range(Start,End+1):
        if j-1 == 0:
            Dp_s[i][j-cur_margin] = 0 + A[i]
        else:
            Dp_s[i][j-cur_margin] = Dp_f[i-1][j-1-pre_margin]+A[i]
    
    pre_margin = cur_margin
print(max(Dp_f[-1][select_num - cur_margin], Dp_s[-1][select_num - cur_margin]))
import numpy as np
n, k = map(int, input().split())
#r, s, p = map(int, input().split())
s, p, r = map(int, input().split())
t = input()
lst = []
arr = np.array(list(t.replace("r",f"{r} ".replace("p",f"{p} ").replace("s",f"{s} ").split())))
arr.reshape(k, n//k+bool(n%k)).T
print(arr)
for b in lst:
  tmp = ""
  for i in b:
    if i!=tmp:
      ans+=eval(i)
      tmp=i
print(ans)


### FIXED CODE ###

n, k = map(int, input().split())
r, s, p = map(int, input().split())
d = {"r":p, "s":r, "p":s}
t = list(input())
dp = [0]*n
for i in range(n):
  if i>=k and t[i]==t[i-k]:
    dp[i] = 0
    t[i] = "x"
  else:
    dp[i] = d[t[i]]
print(sum(dp))
def fill0(s,x,y):
	if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
		A[y][x] = 0
		fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
while 1:
	H,W = map(int,raw_input().split())
	if H == 0: break

### FIXED CODE ###

import sys
sys.setrecursionlimit(20000)
def solve(h,w,count,c):
    if 0 <= h < H and 0 <= w < W and A[h][w] == c:
        A[h][w] = count
        for dh,dw in zip([1,0,-1,0],[0,1,0,-1]):
            solve(h+dh,w+dw,count,c)
while 1:
    H,W = map(int,raw_input().split())
    if H == W == 0: break
    A = [list(raw_input()) for _ in range(H)]
    count = 0
    for h in range(H):
        for w in range(W):
            if type(A[h][w]) is not int:
                solve(h,w,count,A[h][w])
                count += 1
    print count
from collections import*
n=int(input())
d=defaultdict(list)

start=float("inf")
for i in range(n-1):
    a,b=map(int,input().split())
    d[a].append(b)
    d[b].append(a)
    start=min(a,start)
p=sorted(map(int,input().split()))

def DFS(point,TFlist):
    global ans
    global score
    if all(TFlist):
        return 1
    for i in d[point]:
        if TFlist[i-1]:
            continue
        TFlist[i-1]=True
        tmp=p.pop()
        ans[i-1]=tmp
        score.append(tmp)
        #print(score)
        DFS(i,TFlist)
        TFlist[i-1]=False
    return score,ans

TFlist=[False]*(n)
TFlist[start-1]=True
ans=[0 for i in range(n)]
score=[]
ans[start-1]=p.pop()
s,t=DFS(start,TFlist)
#print(d)
print(sum(s))
print(*t)

### FIXED CODE ###

import sys;sys.setrecursionlimit(10**6)
from collections import*
n=int(input())
d=defaultdict(list)

start=float("inf")
for i in range(n-1):
    a,b=map(int,input().split())
    d[a].append(b)
    d[b].append(a)
    start=min(a,start)
p=sorted(map(int,input().split()))

def DFS(point,TFlist):
    global ans
    global score
    if all(TFlist):
        return 1
    for i in d[point]:
        if TFlist[i-1]:
            continue
        TFlist[i-1]=True
        tmp=p.pop()
        ans[i-1]=tmp
        score.append(tmp)
        #print(score)
        DFS(i,TFlist)
        TFlist[i-1]=False
    return score,ans

TFlist=[False]*(n)
TFlist[start-1]=True
ans=[0 for i in range(n)]
score=[]
ans[start-1]=p.pop()
s,t=DFS(start,TFlist)
#print(d)
print(sum(s))
print(*t)
from sys import *

def ans()
    W = int(input().split()[1])
    C = [0] *-~ W

    for e in stdin:
        v,w=map(int,e.split())

    for i in range(W, w-1, -1):
        t = v + C[i - w]

    if t > C[i]:
        C[i] = t

    print(C[W])

ans()


### FIXED CODE ###

N,W=map(int,input().split())
dp=[[0 for i in range(W+1)]for j in range(N+1)]
goods=[]
for i in range(N):
    v,w=map(int,input().split())
    goods.append([v,w])

    
for i in range(N):
    v=goods[i][0]
    w=goods[i][1]
    for j in range(W+1):
        dp[i+1][j]=max(dp[i][j],dp[i+1][j])
        next_w=j+w
        next_v=dp[i][j]+v
        if(next_w<=W and next_v>dp[i+1][next_w]):
            dp[i+1][next_w]=next_v

ans=0
for i in range(W+1):
    ans=max(ans,dp[N][i])
print(ans)
S=list(input())
li=0
li2=[]
for i in S:
	if i=='A' or i=='C' or i=='G' or i=='T':
		li+=1
	else:
		li2.append(li)
		li=0
print(max(li2))
print(li2)

### FIXED CODE ###

S=list(input())
li=0
li2=[]
for i in S:
	if i=='A' or i=='C' or i=='G' or i=='T':
		li+=1
	else:
		li2.append(li)
		li=0
li2.append(li)
print(max(li2))
a=input()
b=map(int,input().stlip())
ans=0

while True:
for s in b
 if b[s]%2!=0
  break
 else:
   b[s]=b[s]/2
   ans+=1
print(ans)

### FIXED CODE ###

b=[]
a=input()
b=map(int,input().split())
ans=[]
f_ans=0
for i in b:
 d=0
 while i % 2 == 0:
   i=i/2
   d+=1
 ans.append(d)
 f_ans=min(ans)
print(f_ans)
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print(((H-h) * (W-w))

### FIXED CODE ###

H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print((H-h) * (W-w))
from functools import reduce
from math import gcd

input()
print(reduce(gcd, map(int, input().split())))

### FIXED CODE ###

from functools import reduce

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

input()
print(reduce(gcd, map(int, input().split())))
N = int(input())
A = [int(num) for num in input().split()]

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9)+7)
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(num) for num in input().split()]

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9+7)
print(ans)
N = input()
input_data = [input() for i in range(N)]

num = 0
while input_data[num] > 0 :
	print("Case","{0}:".format(num+1),"{1}".format(input_data[num]))
	num+=1

### FIXED CODE ###

input_data = []
while 1:
	n = int(input())
	if n == 0:
		break
	input_data.append(n)
n=0
for i in input_data:
	print("Case {}:".format(n+1),"{}".format(input_data[n]))
	n+=1
from math import gcd

k = int(input())
ans = 0

for a in range(1,k+1):
    if i == 1:
        ans += k*k
        continue
    for b in range(1,k+1):
        n = gcd(a,b)
        if n == 1:
            ans += k
            continue
        for c in range(1,k+1):
            ans += gcd(n,c)
print(ans)

### FIXED CODE ###

n = input()

if n.count("7") > 0:
    print("Yes")
else:
    print("No")
import sys, math, itertools, collections, bisect
n,k=map(int,input().split())
h=[]
for i in range(n):
    tmp=int(input())
    h.append(tmp)
h.sort()
min=10000000000
for i in range(len(h)-2):
    tmp2=h[i+k-1]-h[i]
    if min>tmp2:
        min=tmp2
print(min)


### FIXED CODE ###

import sys, math, itertools, collections, bisect
n,k=map(int,input().split())
h=[]
for i in range(n):
    tmp=int(input())
    h.append(tmp)
h.sort()
min=10000000000
for i in range(len(h)-k+1):
    tmp2=h[i+k-1]-h[i]
    if min>tmp2:
        min=tmp2
print(min)
import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    a_sum = []
    b_sum = []
    for i in range(1, len(a)+1):
        a_sum.append(sum(a[0:i]))
    for i in range(1, len(b)+1):
        b_sum.append(sum(b[0:i]))

    ans = 0
    j = m - 1
    for i in range(n):
        if a_sum[i] > k:
            break
        while b_sum[j] > k - a_sum[i]:
            j -= 1
        ans = max(ans, (i+1)+(j+1))

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    a_sum = [0]
    b_sum = [0]
    for i in range(len(a)):
        a_sum.append(a_sum[i]+a[i])
    for i in range(len(b)):
        b_sum.append((b_sum[i]+b[i]))

    ans = 0
    j = m
    for i in range(n+1):
        if a_sum[i] > k:
            break
        while b_sum[j] > k - a_sum[i]:
            j -= 1
        ans = max(ans, (i+j))

    print(ans)


if __name__ == '__main__':
    main()