Harryxun/stf_run huggingface dataset:
from math import gcd

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

def invalid(a, b):
    if a > b:
        a, b = b, a
    return (b % a == 0 and ((b - a) // 2) % a != 0)

def main():
    N, M = map(int, input().split())
    A = list(set(map(int, input().split())))
    A.sort()
    if len(A) == 1:
        l = A[0]
    else:
        if invalid(A[0], A[1]):
            return 0
        l = lcm(A[0], A[1])
        for i in A[2:]:
            if invalid(l, i):
                return 0
            if l % i == 0:
                continue
            l = lcm(l, i)
    return (M + l // 2) // l

print(main())


### FIXED CODE ###

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

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

def invalid(a, b):
    if a > b:
        a, b = b, a
    return (b % a == 0 and ((b - a) // 2) % a != 0)

def main():
    N, M = map(int, input().split())
    A = list(set(map(int, input().split())))
    A.sort(reverse=True)
    if len(A) == 1:
        l = A[0]
    else:
        if invalid(A[0], A[1]):
            return 0
        l = lcm(A[0], A[1])
        for i in A[2:]:
            if invalid(l, i):
                return 0
            if l % i == 0:
                continue
            if l // 2 > M:
                return 0
            l = lcm(l, i)
    return (M + l // 2) // l

print(main())
%%test_input https://abc108.contest.atcoder.jp/tasks/abc108_b
x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
x3, y3 = x2 - dy, y2 + dx
x4, y4 = x3 - dx, y3 - dy
print('{} {} {} {}'.format(x3, y3, x4, y4))

### FIXED CODE ###

x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
x3, y3 = x2 - dy, y2 + dx
x4, y4 = x3 - dx, y3 - dy
print('{} {} {} {}'.format(x3, y3, x4, y4))
N = int(input())
K = int(input())
x = [int(i) for i in input().split()]

ans = 0
if K == 1:
    print(2*N)
else:
    for xi in x:
        if xi < K//2:
            ans += xi*2
        else:
            ans += (K-xi)*2
    print(ans)  

### FIXED CODE ###

N = int(input())
A = int(input())
print(N**2 - A)
n = int(input())
s = list(str(input()))
ans=0
for i in range(len(s) - 3):
    if list[i] = 'A':
        if list[i + 1] = 'B':
            if list[i + 2] = 'C':
                ans+=1
print(ans)

### FIXED CODE ###

n = int(input())
s = list(str(input()))
ans=0
for i in range(len(s) - 2):
    if s[i] == 'A':
        if s[i + 1] == 'B':
            if s[i + 2] == 'C':
                ans+=1
print(ans)
import sys

# import numpy as np
import math
from fractions import gcd
from collections import deque
import bisect

sys.setrecursionlimit(10000)


def factorial(n):
    w = 10**9 + 7
    table = [1]*(n+1)
    for i in range(1, n+1):
        table[i] = table[i-1]*i % w
    return table


def modinv(a, m):
    b = m
    u = 1
    v = 0

    while b > 0:
        t = a // b
        a -= t * b
        a, b = b, a
        u -= t * v
        u, v = v, u
    u %= m
    if u < 0:
        u += m
    return u


def moddiv(x, y, m=10**9+7):
    y_inv = modinv(y, m)
    return x * y_inv % m


def perm(N1, N2):
    table = factorial(N1+N2)
    s = table[N1+N2]
    a = table[N1]
    b = table[N2]
    return moddiv(moddiv(s, a), b)


def main():
    # map(int, input().split())
    # l = list(map(int, input().split()))

    x, y = map(int, input().split())
    diff = abs(x-y)

    if diff == 0:
        if x % 3 != 0:
            return
        cnt = x // 3
        ret = perm(cnt, cnt)
    else:
        if (min(x, y)-diff) % 3 != 0:
            return
        cnt = (min(x, y) - diff) // 3
        ret = perm(cnt, cnt+diff)

    print(ret)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

# import numpy as np
import math
from fractions import gcd
from collections import deque
import bisect

sys.setrecursionlimit(1000000)


def factorial(n):
    w = 10**9 + 7
    table = [1]*(n+1)
    for i in range(1, n+1):
        table[i] = table[i-1]*i % w
    return table


def modinv(a, m):
    b = m
    u = 1
    v = 0

    while b > 0:
        t = a // b
        a -= t * b
        a, b = b, a
        u -= t * v
        u, v = v, u
    u %= m
    if u < 0:
        u += m
    return u


def moddiv(x, y, m=10**9+7):
    y_inv = modinv(y, m)
    return x * y_inv % m


def perm(N1, N2):
    table = factorial(N1+N2)
    s = table[N1+N2]
    a = table[N1]
    b = table[N2]
    return moddiv(moddiv(s, a), b)


def main():
    # map(int, input().split())
    # l = list(map(int, input().split()))

    x, y = map(int, input().split())
    diff = abs(x-y)

    if diff == 0:
        if x % 3 != 0:
            print(0)
            return
        cnt = x // 3
        ret = perm(cnt, cnt)
    else:
        if (min(x, y)-diff) % 3 != 0 or min(x, y) - diff < 0:
            print(0)
            return
        cnt = (min(x, y) - diff) // 3
        ret = perm(cnt, cnt+diff)

    print(ret)


if __name__ == "__main__":
    main()
s=input()
k=int(input())
a=[]
for i in range(0,len(s)):
    for j in range(1,len(s)+1):
        a.append(s[i:j])
num = a.count("")
for i in range(num):
    a.remove("")
a=set(a)
a=sorted(a)

print(a[k-1])

### FIXED CODE ###

s=input()
k=int(input())
a=[s[i:i+j+1] for i in range(len(s)) for j in range(k+1)]
a=set(a)
a=sorted(a)
print(a[k-1])
x=int(input())
if x<=99:
    print(0)
    exit()
dp=[0]*(x+1)
for i in range(100):
    dp[i]=0
for i in range(100,106):
    dp[i]=1
for i in range(106,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[-1])

### FIXED CODE ###

x=int(input())
if x<=99:
    print(0)
    exit()
if x<=105:
    print(1)
    exit()
dp=[0]*(x+1)
for i in range(100):
    dp[i]=0
for i in range(100,106):
    dp[i]=1
for i in range(106,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[-1])
if N[0] == "7" or N[1] == "7" or N[2] == "7":
	print("Yes")
else:
    print("No")

### FIXED CODE ###

N = input()
if N[0] == '7' or N[1] == '7' or N[2] == '7':
  print("Yes")
else:
  print("No")
import numpy as np
import math
from bisect import bisect

N, D, A = map(int, input().split())
xh = [list(map(int, input().split())) for _ in range(N)]
xh.sort(key=lambda x: x[0])
x = np.array([i[0] for i in xh])
h = np.array([i[1] for i in xh])
h_int = np.ceil(h/A)

cnt=0
for i in range(len(x)):
    if h_int[i]<=0: continue
    cnt+=h_int[i]
    r = bisect(x, x[i]+2*D)
    h_int[i+1:r] = h_int[i+1:r]-h_int[i]

print(int(cnt))

### FIXED CODE ###

#import numpy as np
import math
from bisect import bisect

N, D, A = map(int, input().split())
xh = [list(map(int, input().split())) for _ in range(N)]
xh.sort(key=lambda x: x[0])
x = [i[0] for i in xh]
h = [i[1] for i in xh]
#h_int = np.ceil(h/A)

cnt=0
damage=[0]*(N+1)

for i in range(len(x)):
    damage[i] += damage[i-1]
    h[i] -= damage[i]
    if h[i]<=0: continue
    h_int =  math.ceil(h[i]/A)
    cnt+=h_int
    damage[i]+=h_int*A
    r=bisect(x,x[i]+2*D)
    #print(damage[i])
    damage[r]-= A*h_int
    

print(int(cnt))
A, B = map(int, input().split(' '))

answers = [A+B, A-B, A*B, A/B]
print(max(answers))

### FIXED CODE ###

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

answers = [A+B, A-B, A*B]
print(max(answers))
def f(y,x,c0):
  global A
  c=A[y][x]
  if c=="X" or c!=c0:
    return 0
  else:
    A[y][x]="X"
    for i,j in [[0,-1],[0,1],[-1,0],[1,0]]:
      f(y+i,x+j,c0)
    return 1

while 1:
  H,W=map(int,raw_input().split())
  if H==W==0: break
  A=[["X" for _ in range(W+2)] for _ in range(H+2)]
  for i in range(H):
    s=raw_input()
    for j in range(W): A[i+1][j+1]=s[j]
  c=0
  for i in range(1,H+1):
    for j in range(1,W+1):
      c+=A[i][j]
#      c+=f(i,j,A[i][j])
  print c

### FIXED CODE ###

def f(y,x,a):
  M.append([y,x])
  while M:
    y,x=M.pop()
    if A[y][x]==a:
      A[y][x]=' '
      for i,j in [[0,-1],[-1,0],[0,1],[1,0]]: M.append([y+i,x+j])
  return 1

M=[]
while 1:
  H,W=map(int,raw_input().split())
  if H==W==0: break
  A=[list(' '*(W+2)) for _ in range(H+2)]
  for i in range(H): A[i+1][1:W+1]=list(raw_input())
  c=0
  for i in range(1,H+1):
    for j in range(1,W+1):
      a=A[i][j]
      if a!=' ': c+=f(i,j,a)
  print c
n, k = map(int, input().split())
d = [int(input())]
a = [list(map(int, input().split()))]

for i in range(1,k):
  d.append(int(input()))
  a.append(list(map(int, input().split())))
  
all_sunuke = [1]*n

for j in range(0, k):
  for m in range(0, d[j]):
    if a[m] != 0:
      all_sunuke[m] =all_sunuke[m]*0

print(sum(all_sunuke))


### FIXED CODE ###

n, k = map(int, input().split())
all_sunuke = [1]*n

for i in range(0,k):
  d = int(input())
  a = list(map(int, input().split()))
  for j in range(0,d):
      all_sunuke[(a[j]-1)] =all_sunuke[(a[j]-1)]*0

print(sum(all_sunuke))
N = int(input())
total = 0
for i in range(N):
  a,b = map(int(input()))
  if b = "JPY":
    total += a
  else:
    total += a * 380000
print(total)

### FIXED CODE ###

N = int(input())
total = 0
for i in range(N):
  a,b = map(str,input().split())
  if b == "JPY":
    total += float(a)
  else:
    total += float(a) * 380000
print(total)
N, L = map(int, input().split())
S = []
for i in range(N):
  S.append(input())
S.sort()
S = ''.join(S)
print(S)

### FIXED CODE ###

f = False
a = input().split(' ')
for i in range(3):
  a[i]=int(a[i])
while True:
  for i in range(3):
    if a[i] != 5 and a[i] != 7:
      print('NO')
      f = True
      break
  if f == True:
    print(2)
    break
  if a[0] + a[1] + a[2] == 17:
    print('YES')
    break
  else:
    print('NO')
    break
a,b = map(float,input().split())

a = int(a)
b = int(b*100)
tmp = str(a*b)[:-2]
print(int(tmp))

### FIXED CODE ###

a,b = map(str,input().split())
a = int(a)
if len(b) == 4:
    b = int(b[0] + b[2:])
    
else:
    b = int(b[0] + b[2] +'0')
tmp = str(a*b)
if len(tmp) <=2:
    print(0)
else:
    tmp = str(a*b)[:-2]
    print(int(tmp))
N = int(input())
List = [0 for _ in range(1000)]

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      k = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if k<=N:
        List[k-1] += 1
        
for i in range(N):
  print(List[i])

### FIXED CODE ###

N = int(input())
List = [0 for _ in range(10000)]

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      k = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if k<=N:
        List[k-1] += 1
        
for i in range(N):
  print(List[i])
import sys
import os

import numpy as np
import pandas as pd

n, m = map(int, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
df = pd.DataFrame(lines,
                  columns = ["price", "stock"],
                  dtype = float
                  )
df = df.sort_values(by="price")
price = 0
for i in range(n):
    if m - df.iloc[i]["stock"] > 0:
        price += df.iloc[i]["price"] * df.iloc[i]["stock"]
        m -= df.iloc[i]["stock"]
    else:
        price += df.iloc[i]["price"] * m
        break
print(int(price))

### FIXED CODE ###

import sys
import numpy as np

n, m = map(float, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
lines.sort()
price = 0
for line in lines:
    if m - line[1] > 0:
        price += line[0] * line[1]
        m -= line[1]
    else:
        price += line[0] * m
        break
print(int(price))
import math
N,K = map(int,input().split())
mod = 1000000007

for j in range(K):
    i = j+1
    x = math.factorial(K-1)/math.factorial(K-i)//math.factorial(i-1)
    y = math.factorial(N-K+1)/math.factorial(N-K+1-i)//math.factorial(i)
    ans = int(x*y)
    ans = ans%mod
    print(ans)
    

### FIXED CODE ###

import math
N,K = map(int,input().split())
mod = 1000000007

for j in range(K):
    i = j+1
    p = N-K+1-i
    if p <0:
        p = 0
    x = math.factorial(K-1)//(math.factorial(K-i)*math.factorial(i-1))
    y = math.factorial(N-K+1)//(math.factorial(p)*math.factorial(i))
    ans = x*y
    ans = int(ans%mod)
    print(ans)
from functools import reduce
from fractions import gcd

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

def lcm_list(l):
    lcm = l[0]
    for i in range(len(l)):
        lcm = lcm*l[i] // gcd(lcm, l[i])
    return lcm

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

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)


### FIXED CODE ###

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

if n == m:
    print('Yes')
else:
    print('No')
a,b=map(int(input().split()))

ans=0

if a=b:
  ans+=2*a
  print(ans)
else:
  ans+=2*max(a,b)-1
  print(ans)

### FIXED CODE ###

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

if a==b:
  print(2*a)
  
else:
  print(2*max(a,b)-1)
a, b, c = map(int, input().split())
print(a+b+c)

### FIXED CODE ###

a = str(input())
print(int(a[0]) + int(a[1]) + int(a[2]))
W, H, w, y, r = map(int, input().split())

if (x -r) < 0 or (x + r) > W:
    print("No")
elif (x- r) >= 0 and (x + r) <= W:
    print("Yes")

### FIXED CODE ###

w, h, x, y, r = map(int, input().split())

if x + r <= w and y + r >= 0 and x - r >= 0 and y + r <= h:
    print("Yes")
else:
    print("No")
from math import gcd


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


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

l = lcm(n, m)
g = gcd(n, m)

ng = n // g
mg = m // g
k = 0
flg = True
while True:
    if k * ng >= n or k * mg >= m:
        break
    if s[k * ng] != t[k * mg]:
        flg = False
        break
    k += 1

if flg:
    print(l)
else:
    print(-1)

### FIXED CODE ###

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


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


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

l = lcm(n, m)
g = gcd(n, m)

ng = n // g
mg = m // g
k = 0
flg = True
while True:
    if k * ng >= n or k * mg >= m:
        break
    if s[k * ng] != t[k * mg]:
        flg = False
        break
    k += 1

if flg:
    print(l)
else:
    print(-1)
import numpy as np
n,q=list(map(int, input().split()))
result = {i+1:0 for i in range(n)}
ar = np.eye(n)

for i in range(n-1):
    a,b = list(map(int, input().split()))
    ar[0:a,a-1:b] += 1
for i in range(q):
    a,b = list(map(int, input().split()))
    m = ar[a-1]
    for j in range(len(m)):
        if m[j] != 0:
            result[j+1] += b
        else:
            result[j+1] += 0
r = list(result.values())
res = map(str, r)
print(' '.join(res))

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]

n,q = map(int, input().split())
#長さn個のリストを入れ子にしたリストの作成：adj
adj = [[] for i in range(n)]

#adjに繋がっている要素を上流下流関わらず全て加える。
for j in range(n-1):
    a,b=map(int, input().split())
    adj[a-1].append(b-1)
    adj[b-1].append(a-1) 

#加算する値を合計したリストの作成
queries = [0 for i in range(n)]
for j in range(q):
    p, x = map(int, input().split())
    queries[p-1] += x

ans = [0 for i in range(n)]

#aの値，直前の値，直前のaの値
st = [(0, 0, -1)] 

#つながってる奴の一番後ろから処理していく。
#０スタート→1,2繋がってるなら2にいく。2に3が繋がってるなら次は3。
#3に繋がってるのがなければ1に戻る。
#この際，aの直前の値をタプルで保持したままリストに挿入して保管しておく。
while st:
    #stの先頭を取り出す。初期値は末尾のため-1
    l = st.pop()  
    ans[l[0]] = l[1] + queries[l[0]]
    for v in adj[l[0]]:
        if v != l[2]:
            st.append((v, ans[l[0]], l[0]))

print(*ans)
N,M=map(int,input().split())
X=[int(i) for i in input().split()]
X.sort()
count=[]
sum=0
for i in range(M):
  if i != 0:
    count.append(X[i]-get)
    sum+=count[i-1]
  get=X[i]
count.sort(reverse=True)
if count != []:
  for i in range(N-1):
    sum-=count[i]
print(sum)

### FIXED CODE ###

N,M=map(int,input().split())
X=[int(i) for i in input().split()]
X.sort()
count=[]
sum=0
if N<M:
  for i in range(M):
    if i != 0:
      count.append(X[i]-get)
      sum+=count[i-1]
    get=X[i]
  count.sort(reverse=True)
  if count != []:
    for i in range(N-1):
      sum-=count[i]
print(sum)
s = input()

all = ['SUN','MON','TUE','WED','THU','FRI','SAT']


for i range(7):
	if all[i] == s:
		c = i
        
print(7-i)

### FIXED CODE ###

s = input()
 
all_ = ['SUN','MON','TUE','WED','THU','FRI','SAT']
 
 
for i in range(7):
    if all_[i] == s:
        break
        
print(7-i)
if __name__ == '__main__':
    x=list(map(int,input().split(" ")))
    y = list(map(int, input().split(" ")))
    num=0
    for i in y:
        num+=i
    if x[0]<y:
        print(-1)
    else: print(x[0]-y)

### FIXED CODE ###

N, M = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
sum_a = 0
for i in a:
    sum_a += i
if sum_a > N:
    print(-1)
else:
    print(N - sum_a)
O = input()
E = input()

password = []

for i in range(len(O)-1):
    password.append(O[i])
    password.append(E[i])
if len(O)-len(E)==1:
    password.append(O[len(O)])

print(password)


### FIXED CODE ###

O = input()
E = input()

password = O[0] + E[0]

if len(O)-len(E)==1:
    for i in range(1, len(O)-1):
        password = password + O[i] + E[i]
    password = password + O[-1]
else:
    for i in range(1, len(O)):
        password = password + O[i] + E[i]

print(password)
mod=10**9+7

N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
dp=[1,1]
m=0
if a[0]==1:
    dp[1]=0
    m+=1
for i in range(2,N+1):
    if m<M and i==a[m]:
        dp.append(0)
        m+=1
    else:
        dp.append((dp[-1]+dp[-2])%mod)
print(dp[-1])

### FIXED CODE ###

mod=10**9+7

N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
dp=[1,1]
m=0
if M>0 and a[0]==1:
    dp[1]=0
    m+=1
for i in range(2,N+1):
    if m<M and i==a[m]:
        dp.append(0)
        m+=1
    else:
        dp.append((dp[-1]+dp[-2])%mod)
print(dp[-1])
while 1:
    d, w = map(int, input().split())
    if d == w == 0:
        break
    E = [[*map(int, input().split())] for i in range(d)]
    ans = 0
    for x2 in range(d):
        for y2 in range(w):
            for x1 in range(x2-1):
                for y1 in range(y2-1):
                    co = 10**18
                    for x in range(x1, x2+1):
                        co = min(co, E[x][y1], E[x][y2])
                    for y in range(y1, y2+1):
                        co = min(co, E[x1][y], E[x2][y])
                    ci = 0
                    cnt = 0
                    for x in range(x1+1, x2):
                        for y in range(y1+1, y2):
                            ci = max(ci, E[x][y])
                            cnt += E[x][y]
                    if ci < co:
                        ans = max(ans, (x2-x1-1)*(y2-y1-1)*co - cnt)
    print(ans)

### FIXED CODE ###

while 1:
    d, w = map(int, input().split())
    if d == w == 0:
        break
    E = [list(map(int, input().split())) for i in range(d)]
    ans = 0
    for x2 in range(d):
        for y2 in range(w):
            for x1 in range(x2-1):
                for y1 in range(y2-1):
                    co = 10**18
                    for x in range(x1, x2+1):
                        co = min(co, E[x][y1], E[x][y2])
                    for y in range(y1, y2+1):
                        co = min(co, E[x1][y], E[x2][y])
                    ci = cnt = 0
                    for x in range(x1+1, x2):
                        for y in range(y1+1, y2):
                            ci = max(ci, E[x][y])
                            cnt += E[x][y]
                    if ci < co:
                        ans = max(ans, (x2-x1-1)*(y2-y1-1)*co - cnt)
    print(ans)
import math
X = list(map(int, input().split()))
N = X[0]
K = X[1]
A = math.inf
if K == 1:
  print(0)
else:  
  while True:
    A = abs(N - K)
    if N > A:
      N = A
    else:
      break
  print(N)

### FIXED CODE ###

X = list(map(int, input().split()))
N = X[0]
K = X[1]
t = N % K
s = K - t
if t <= s:
  print(t)
else:
  print(s)
x,a=map(int,input().split)

if x<a:
  print(0)
else:
  print(10)

### FIXED CODE ###

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

if x<a:
  print(0)
else:
  print(10)
N,M = map(int,input().split())

color = []
colorStorage = []
for i in range(N):
    color.append(i)
    colorCount.append([i])

for _ in range(M):
    p,q = map(int,input().split())
    p -= 1
    q -= 1
    if color[p] == color[q]:
        continue
    else:
        x = color[p]
        y = color[q]
        if len(colorStorage[x]) >= len(colorStorage[y]):
            for elem in colorStorage[y]:
                color[elem] = x
                colorStorage[x].append(elem)
            colorStorage[y] = []
        else:
            for elem in colorStorage[y]:
                color[elem] = y
                colorStorage[y].append(elem)
            colorStorage[x] = []
maxL = 0
for colorList in colorStorage:
    if maxL < len(colorList):
        maxL = colorList
print(maxL)



### FIXED CODE ###

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

color = []
colorStorage = []
for i in range(N):
    color.append(i)
    colorStorage.append([i])

for _ in range(M):
    p,q = map(int,input().split())
    p -= 1
    q -= 1
    if color[p] == color[q]:
        continue
    else:
        x = color[p]
        y = color[q]
        if len(colorStorage[x]) >= len(colorStorage[y]):
            for elem in colorStorage[y]:
                color[elem] = x
                colorStorage[x].append(elem)
            colorStorage[y] = []
        else:
            for elem in colorStorage[x]:
                color[elem] = y
                colorStorage[y].append(elem)
            colorStorage[x] = []
maxL = 0
for colorList in colorStorage:
    if maxL < len(colorList):
        maxL = len(colorList)
print(maxL)
import math

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

used={}
unused={}

def gcd(x,y):
    if x==-1 or y==-1:
        return max(x,y)
    return math.gcd(x,y)

def rec(i,x,f):
    if i+1==N and f==1:
        return x
    elif i+1==N and f==0:
        return -1
    
    if f==1 and used.get(x,-1)>0:
        return used[x]
    if f==0 and unused.get(x,-1)>0:
        return unused[x]
    
    if f==0:
        unused[x]=rec(i+1,gcd(x,A[i+1]),0)
        used[x]=rec(i+1,x,1)
        return max(unused[x],used[x])
    else:
        used[x]=rec(i+1,gcd(x,A[i+1]),1)
        return used[x]


print(rec(-1,-1,0))


### FIXED CODE ###

import fractions

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

L=[0]*(N+1)
R=[0]*(N+1)

def gcd(x,y):
    if x==0 or y==0:
        return max(x,y)
    return fractions.gcd(x,y)

for i in range(N):
    j=N-i

    L[i+1]=gcd(L[i],A[i])
    R[j-1]=gcd(R[j],A[j-1])
ans=0

for i in range(N):
    ans=max(ans,gcd(L[i],R[i+1]))

print(ans)
a, b, c, d=map(int,input().split)
print("Yes" if abs(a-c)<=d or abs(a-b)<=d and abs(b-c)<=d else "No")

### FIXED CODE ###

a, b, c, d=map(int,input().split())
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d and k3<=d:
  print("Yes")
else:
  print("No")
S=list(map(input().split()))
T=list(map(input().split()))
a==0
for i in S:
  if S[i]==T[i]:
    a=a+1
print(a)
    

### FIXED CODE ###

S=input()
T=input()
a=0
for i in range(len(S)):
  if S[i]==T[i]:
    a=a+1
print(a)