Harryxun/stf_run huggingface dataset:
import math
n=int(input())
t = list(map(int, input().split()))
l=[0 for i in range(n)]
ans = t[0]
for i in range(1, n):
    ans = ans * t[i] // math.gcd(ans, t[i])
for j in range(n):
    l[j]=ans//t[j]
print(sum(l)%(10**9+7))

### FIXED CODE ###

import fractions
n=int(input())
t = list(map(int, input().split()))
x=0
ans = t[0]
for i in range(1, n):
    ans = ans * t[i] // fractions.gcd(ans, t[i])
for j in range(n):
    x+=ans//t[j]
print(x%(10**9+7))
import math
import itertools
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)



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


c = itertools.combinations(A, N-1)

a_max = gcd(*A)
for i in c:
    a_max = max(a_max, gcd(*list(i)))

print(a_max)


### FIXED CODE ###

def gcd(x,y):
    if x % y == 0:
        return y
    else:
        x %= y
        return gcd(y, x)

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

l_gcd = [-1] * N
r_gcd = [-1] * N

for i in range(N):
    if i == 0:
        l_gcd [0] = blackboard[0]
    else:
        l_gcd[i] = gcd(l_gcd[i-1],blackboard[i])


for i in reversed(range(N)):
    if i == N - 1:
        r_gcd[N-1] = blackboard[N-1]
    else:
        r_gcd[i] = gcd(r_gcd[i+1],blackboard[i])


#左端と右端のときの値を予め比較しておく。
ans = max(l_gcd[-2],r_gcd[1])

for i in range(1,N-1):
    ans = max(ans,gcd(l_gcd[i-1],r_gcd[i+1]))
print(ans)
n = int(input())
now_time = 0
global tf
tf = False

def finish_work(now_time, works):
    global tf
    if len(works) == 0 or tf == True:
        tf = True
        return True
    sums = sum([i[0] for i in works]) 
    maxs = max ([i[1] for i in works])
    if maxs < sums:
        return 0
    for index, i in enumerate(works):
        if now_time + i[0] <= i[1]:
            work_list = works.copy()
            work_list.pop(index)
            finish_work(now_time + i[0], work_list)

works = []

for i in range(n):
    a = list(map(int, input().split()))
    works.append(a)

for index, i in enumerate(works):
    
    if now_time + i[0] <= i[1]:
        work_list = works.copy()
        work_list.pop(index)
        finish_work(now_time + i[0], work_list)

if tf:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import fractions
a, b, c, d = map(int, input().split())

ans = b - (b // c + b//d - b//(c*d // fractions.gcd(c, d))) - ( a - 1  - ((a-1) // c + (a-1)//d - (a-1)//(c * d //fractions.gcd(c, d))))  

print(ans)
N= int(input())

graph = {i+1:[] for i in range(N)}

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

def DFS(a, b, c):
    for i, j in graph[b]:
        if(i != a):
            visited[i] = c+j
            DFS(b, i, c+j)
DFS(0, K, 0)
             
for i in range(Q):
    x, y = map(int, input().split())
    print(visited[x]+visited[y])
    

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N = int(input())

graph = [[] for _ in range(N)]

for _ in range(N-1):
    a, b, c = map(int, input().split())
    graph[a-1].append((b-1, c))
    graph[b-1].append((a-1, c))
    
Q, K = map(int, input().split())
visited = [0 for _ in range(N)]

def DFS(a, b, c):
    for i, j in graph[b]:
        if(i != a):
            visited[i] = c+j
            DFS(b, i, c+j)
DFS(-1, K-1, 0)
             
for _ in range(Q):
    x, y = map(int, input().split())
    print(visited[x-1]+visited[y-1])
S = input()
if S == 'ABC':
    print 'ARC'
else:
    print 'ABC'

### FIXED CODE ###

S = input()
if S == 'ABC':
    print('ARC')
else:
    print('ABC')
# a,b,c=map(int,input().split());print("Yes" if a<=c<=b else "No")

# a,b,c=map(int,input().split());print('NYoe s'[a<=c<=b::2])
# a,b,c=map(int,input().split())
# print(a,b,c)
# import numpy as np
# arr = np.fromstring(input(), sep=" ")
# print(arr)


*s,c=input().split();print(["No","Yes"][int(s[0])<=c<=s[1]])
# print(*s[2::]<=c)
# print(exec("$0=substr(\"YesNo\",$3<$1||$3>$2?4:1,3))")

### FIXED CODE ###

a,b,c=map(int,input().split());print("Yes" if a<=c<=b else "No")
S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60
print(h,':',m,":",s,""")
#print("{a}:{b}:{c}".format(h,m,s))

### FIXED CODE ###

S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60
print(h,':',m,":",s , sep ="")
#print("{a}:{b}:{c}".format(h,m,s))
K = int(input())
S = input()
if int(len(S)) == K:
  print(S)
else:
  sth = S.split(S[K])
  print(sth[0]+"...")

### FIXED CODE ###

K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S)):
    if i < K:
      print(S[i],end="")
    else:
      print("...")
      break
S = input()
N = len(S)

if S[-1] == "1":
    print(-1)
    exit()

R = []
for i in range(N // 2):
    if S[i] == "1":
        if S[N - i - 2] == "1":
            R.append(i + 1)
        else:
            print(-1)
            exit()

R_max = max(R)
for s in S[1:R_max-1]:
    if s == "0":
        print(-1)
        exit()


# 構築
T = [[] for i in range(N + 1)]

# R_maxの数だけ伸ばす
for i in range(1, R_max + 1):
    T[i].append(i + 1)

# 他はすべて1につなぐ
for i in range((R_max + 2), N + 1):
    T[1].append(i)

for i in range(1, N+1):
    for t in T[i]:
        print(i, t)


### FIXED CODE ###

S = input()
N = len(S)

if S[0] == "0" or S[-1] == "1":
    print(-1)
    exit()

D = {}
for i in range(N - 1):
    D[i + 1] = S[i]
for i in range(1, N):
    if D[i] != D[N - i]:
        print(-1)
        exit()

# 構築
T = [[] for i in range(N)]

next = 1
mark = 0
for i in range(N):
    child = mark + 1
    if S[i] == "0":
        next += 1
    else:
        for n in range(next):
            T[mark].append(child)
            child += 1
        next = 1
        mark = child - 1

for i in range(N):
    for t in T[i]:
        print(i + 1, t + 1)
A,B = map(int,input().split())
S = str(input())
if len(S) > A+B+1:
        print("No1")
        exit()
if len(S[A+1:]) != B:
        print("No2")
        exit()
if S == S[0:A]+"-"+S[A+1:] and "-" not in S[0:A] and "-" not in S[A+1:] :
        print("Yes")
else:
        print("No")



### FIXED CODE ###

N = int(input())
print(48-N)
n,m = [int(x) for x in input().split()]
py = []
for i in range(m):
    p,y = [int(x) for x in input().split()]
    py.append([p,y,i+1])

def zero(num):
    return str(num).zfill(6)


if m == 1:
    print(zero(py[0])+zero(1))
else:
    year_py = sorted(py, key=lambda x: x[1])
    dic = {str(x): 0 for x in range(1,m+1)}

    for i in range(m):
        dic[str(year_py[i][0])] += 1
        year_py[i].append(dic[str(year_py[i][0])])
    yb_py = sorted(year_py, key=lambda x: x[2])

    for i in range(m):
        print(zero(yb_py[i][0]) + zero(yb_py[i][3]))

### FIXED CODE ###

n,m = [int(x) for x in input().split()]
py = []
for i in range(m):
    p,y = [int(x) for x in input().split()]
    py.append([p,y,i+1])

def zero(num):
    return str(num).zfill(6)


if m == 1:
    print(zero(py[0][0])+zero(1))
else:
    year_py = sorted(py, key=lambda x: x[1])
    dic = {str(x): 0 for x in range(1,n+1)}

    for i in range(m):
        dic[str(year_py[i][0])] += 1
        year_py[i].append(dic[str(year_py[i][0])])
    yb_py = sorted(year_py, key=lambda x: x[2])

    for i in range(m):
        print(zero(yb_py[i][0]) + zero(yb_py[i][3]))
a, b, c, d = map(int input())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')

### FIXED CODE ###

a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')
N, K = map(int, input().split())
A = list(map(int, input().split()))

temp = 0
temp_l = [1]
now = 1
while True:
    temp += 1
    pre = now
    now = A[pre-1]
    if now in temp_l:
        end = now
        break
    else:
        temp_l.append(now)

s_index = temp_l.index(end)
repeat = temp - s_index
K -= s_index
K = K % repeat

print(temp_l[s_index:][K])

### FIXED CODE ###

S = list(input())
T = list(input())

ans = 'Yes'
for i in range(len(S)):
    if S[i] != T[i]:
        ans = 'No'

print(ans)
import sys

n = int(input())
a = list(map(int, input().split()))
for i in a:
  if a % 2 == 0 and (a % 3 != 0 and a % 5 != 0):
    print("DENIED")
    sys.exit()
print("APPROVED")    

### FIXED CODE ###

num = int(input())
a = list(map(int, input().split()))
b = 0
for i in a:
  if i % 2 != 1 and i % 3 != 0 and i % 5 != 0:
    b += 1
if b != 0:
  print("DENIED")
else:
  print("APPROVED")
from functools import reduce
l = int(input())
src = list(map(lambda x: 1 if x=="." else 0, input()))
lb = 0
rw = sum(src)
a = rw
for i in range(l):
  if src[i]==0:
    lb+=1
  else:
    rw-=1
  a = min(ans, left_black + right_white)
  if ans==0:
    break
print(ans)

### FIXED CODE ###

from functools import reduce
l = int(input())
src = list(map(lambda x: 1 if x=="." else 0, input()))
left_black = 0
right_white = sum(src)
ans = right_white
for i in range(l):
  if src[i]==0:
    left_black+=1
  else:
    right_white-=1
  ans = min(ans, left_black + right_white)
  if ans==0:
    break
print(ans)
N, C = map(int, input().split())
record = [[0 for _ in range(10 ** 5)] for _ in range(C)]
for _ in range(N):
    s, t, c = map(int, input().split())
    s -= 1
    c -= 1
    record[c][s] += 1
    record[c][t] -= 1
cum = []
for i in range(C):
    tmp = [record[i][0]]
    for j in range(10 ** 5 - 1):
        tmp.append(tmp[-1] + record[i][j + 1])
    cum.append(tmp)
ans = 0
for i in range(10 ** 5):
    tmp = 0
    for j in range(C):
        tmp += cum[j][i]
    ans = max(tmp, ans)
print(ans)    

### FIXED CODE ###

N, C = map(int, input().split())
max_size = 10 ** 5
record_list = [[int(i) - 1 for i in input().split()] for _ in range(N)]
ans_list = [0 for _ in range(max_size)]
for c in range(C):
    T = [0 for _ in range(max_size + 1)]
    for s, t, i in record_list:
        if i == c:
            T[s] += 1
            T[t + 1] -= 1
    for i in range(max_size):
        T[i + 1] += T[i]
    for i in range(max_size):
        ans_list[i] += T[i] > 0
print(max(ans_list))
# -*- coding: UTF-8 -*-

nums = input().split()
set_nums = list(set(nums))
other = sum(nums) - sum(set_nums)
set_nums.remove(other)
print(set_nums[0])

### FIXED CODE ###

nums = map(int, input().split())
d = {}
for n in nums:
  d.setdefault(n, 0)
  d[n] += 1
print(list(d.keys())[list(d.values()).index(1)])
n=int(input())
dp=[[0]*3 for i  in range(n+1)]
for i in range(n):
  a,b,c=map(int,input())
  dp[i+1][0]=max(dp[i][1],dp[i][2])+a
  dp[i+1][1]=max(dp[i][0],dp[i][2])+b
  dp[i+1][2]=max(dp[i][0],dp[i][1])+c
print(max(dp[-1]))



### FIXED CODE ###

n=int(input())
dp=[[0]*3 for i  in range(n+1)]
for i in range(n):
  a,b,c=map(int,input().split())
  dp[i+1][0]=max(dp[i][1],dp[i][2])+a
  dp[i+1][1]=max(dp[i][0],dp[i][2])+b
  dp[i+1][2]=max(dp[i][0],dp[i][1])+c
print(max(dp[-1]))
A,B = map(int,input().split())
L=[]#公約数のリスト
for i in range(1,min(A,B)+1):
  if A%i==0 and B%i==0:
    L +=[i]
#公約数の中の素数を数える。素数でないものを取り除く
for j in range(len(L)):
  for k in range(2,L[j]):
    if L[j]%k==0:
      del L[j]
      break
print(len(L))

### FIXED CODE ###

def gcd(a,b):#最大公約数
  return a if b == 0 else gcd(b,a%b)

def prime_factorize(n):#素因数分解
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
A,B = map(int,input().split())
X=gcd(A,B)
P=prime_factorize(X)

answer=len(set(P))+1
print(answer)
S = input()
Q = int(input())
fg = False
que2 = []
que2.append(S)

for _ in range(Q+1):
    que = list(map(str, input().split()))
    if que[0] == "1":
        que2.reverse()
    elif que[1] == "1":
        que2.insert(0,que[2])
    elif que[1] == "2":
        que2.append(que[2])
        
ans = "".join(que2)
print(ans)


### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())
q = deque(S)
fg = False
for i in range(Q):
    que = list(map(str , input().split()))
    if que[0] == "1":
        fg = not fg
    elif (que[1] == "1" and fg == False) or (que[1] == "2" and fg == True) :
        q.appendleft(que[2])
    else:
        q.append(que[2])
if fg:
    q.reverse()
print("".join(q))
N,u,v = map(int,input().split())
u -= 1
v -= 1

du = [0]*N
dv = [0]*N
du[u] = 0
dv[v] = 0
G = [0]*N

def dfs(v, d, p, dis):
    dis[v] = d
    if G[v] != 0:
        for u in G[v]:
            if( u == p):
                continue
            else:
                dfs( u, d+1, v, dis )

def calcDist(s, dist):
    dfs(s, 0, -1, dist)

for i in range(N-1):
    e1,e2 = map(int, input().split())
    e1 -= 1
    e2 -= 1
    if G[e1] == 0:
        G[e1] = [e2]
    else:
        G[e1].append(e2)
    if G[e2] == 0:
        G[e2] = [e1]
    else:
        G[e2].append(e1)

if G[u]==[v]:
    ans = 0
else:    

    calcDist(v,dv)
    calcDist(u,du)
    maxD = 0
    for idu,idv in zip(du,dv):
        if idu < idv:
            maxD = max(maxD, idv)       
    ans = maxD-1
    
print(ans)

### FIXED CODE ###

import heapq

N,u,v = map(int,input().split())
u -= 1
v -= 1

#du = [0]*N
#dv = [0]*N
du = [float('inf')]*N
dv = [float('inf')]*N
#du[u] = 0
#dv[v] = 0
q = []

G = [[]]*N

'''
def dfs(v, d, p, dis):
    dis[v] = d
    if G[v] != []:
        for u in G[v]:
            if( u == p):
                continue
            else:
                dfs( u, d+1, v, dis )

def calcDist(s, dist):
    dfs(s, 0, -1, dist)
'''
def calcDist(s, dist):
    heapq.heappush(q,[0, s])
    dist[s] = int(0)
    
    while q!=[]:
        p = heapq.heappop(q)
        pv = p[1]
        if dist[pv] < p[0] :
            continue
        for i in range(len(G[pv])):
            eto = G[pv][i]
            if dist[eto] > dist[pv] + 1:
                 dist[eto] = int(dist[pv] + 1)
                 heapq.heappush(q, [dist[eto], eto])


for i in range(N-1):
    e1,e2 = map(int, input().split())
    e1 -= 1
    e2 -= 1
    if G[e1] == []:
        G[e1] = [e2]
    else:
        G[e1].append(e2)
    if G[e2] == []:
        G[e2] = [e1]
    else:
        G[e2].append(e1)

if v in G[u]:
    ans = 0
else:    

    calcDist(v,dv)
    calcDist(u,du)
    maxD = 0
    for idu,idv in zip(du,dv):
        if idu < idv:
            maxD = max(maxD, idv)       
    ans = maxD-1
    
print(ans)
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X and i<=N):
  D=D+L[i]
  i=i+1
print(i)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
line = 0
for i in range(N):
    line += L[i]
    if line <= X:
        count += 1
print(count)
dic = {}
for i in xrange(97, 123):
  dic.setdefault(chr(i), 0)

while True:
  input = raw_input()
  if input == "" or input == None:
    break
  for i in xrange(len(input)):
    if input[i].lower() in dic:
      dic[input[i].lower()] += 1

  # print dic
for i in xrange(97, 123):
  print chr(i) + " : " + str(dic[chr(i)])

### FIXED CODE ###

import sys

dic = {}
for i in xrange(97, 123):
  dic.setdefault(chr(i), 0)

line = ""
while True:
  try:
    temp = raw_input()
    # print "temp = " + temp
    if temp != "":
      line += temp
    else:
      break
  except:
    break

# print line

for i in xrange(len(line)):
  try:
    if line[i].lower() in dic:
      dic[line[i].lower()] += 1
  except TypeError:
    continue

  # print dic
for i in xrange(97, 123):
  print chr(i) + " : " + str(dic[chr(i)])
N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

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

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print(int((A+B)/2))
N, Y = map(int, input().split())

a = 0

for i in range(N):
    for ii in range(N):
        iii = N - i - ii
        ans = 10000 * i + 5000 * ii + 1000 * iii
        if ans == Y and J == N:
                print(i,ii,iii)
                a += 1
                break

        #for iii in range(N):
        #    ans = 10000 * i + 5000 * ii + 1000 * iii
        #    J = i + ii + iii
        #    if ans == Y and J == N:
        #        print(i,ii,iii)
        #        a += 1
        #        break
        #if a != 0:
        #    break
    if a != 0:
        break

if a == 0:
    print(-1,-1,-1)


### FIXED CODE ###

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

a = 0

for i in range(N+1):
    for ii in range(N+1):
        iii = N - i - ii
        if iii < 0:
            break
        ans = 10000 * i + 5000 * ii + 1000 * iii
        if ans == Y:
                print(i,ii,iii)
                a += 1
                break

        #for iii in range(N):
        #    ans = 10000 * i + 5000 * ii + 1000 * iii
        #    J = i + ii + iii
        #    if ans == Y and J == N:
        #        print(i,ii,iii)
        #        a += 1
        #        break
        #if a != 0:
        #    break
    if a != 0:
        break

if a == 0:
    print(-1,-1,-1)
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]

A = sorted(A)
B = sorted(B)
C = sorted(C)

BB = [0] * N

cidx = 0
for i in range(N):
    while cidx < N and C[cidx] <= B[i]:
        cidx += 1
    BB[i] = N - cidx

BBB = [0] * N
for i in range(N - 1, -1, -1):
    if (i == N - 1):
        BBB[i] = BB[i]
    else:
        BBB[i] = BB[i] + BBB[i+1]

sum = 0
bidx = 0
for i in range(N):
    while B[bidx] <= A[i]:
        bidx += 1
        if bidx == N:
            break
    if bidx != N:
        sum += BBB[bidx]

print(sum)


### FIXED CODE ###

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

A = sorted(A)
B = sorted(B)
C = sorted(C)

BB = [0] * N

cidx = 0
for i in range(N):
    while cidx < N and C[cidx] <= B[i]:
        cidx += 1
    BB[i] = N - cidx

BBB = [0] * N
for i in range(N - 1, -1, -1):
    if (i == N - 1):
        BBB[i] = BB[i]
    else:
        BBB[i] = BB[i] + BBB[i+1]

sum = 0
bidx = 0
for i in range(N):
    while bidx < N and B[bidx] <= A[i]:
        bidx += 1
    if bidx != N:
        sum += BBB[bidx]

print(sum)
MAX = 2*10**5
def popcount(x):
    return bin(x).count("1")
def solve(n):
    if n == 0:
        return 0
    return 1+solve(n % popcount(n))

N = int(input())
X = input()
num_x = int(X, 2)
p_cnt = X.count('1')
r0_p = num_x % (p_cnt+1)
r0_m = num_x % (p_cnt-1)
for i in range(N):
    if X[i] == '0':
        c_p_cnt = p_cnt+1
        r = r0_p + (2**(N-1-i) % c_p_cnt)
    else:
        c_p_cnt = p_cnt-1
        if c_p_cnt == 0:
            print(0)
            continue
        r = r0_m - (2**(N-1-i) % c_p_cnt)
    print(1 + solve(r % c_p_cnt))



### FIXED CODE ###

def popcount(x):
    return bin(x).count("1")
def solve(n):
    if n == 0:
        return 0
    return 1+solve(n % popcount(n))

N = int(input())
X = input()
num_x = int(X, 2)
p_cnt = X.count('1')
if p_cnt == 1:
    for i in range(N):
        if X[i] == '1':
            print(0)
        elif i == N-1:
            print(2)
        else:
            print(1)
    exit()
r0_p = num_x % (p_cnt+1)
r0_m = num_x % (p_cnt-1)
for i in range(N):
    if X[i] == '0':
        c_p_cnt = p_cnt+1
        r = (r0_p + pow(2, (N - 1 - i), c_p_cnt)) % c_p_cnt
    else:
        c_p_cnt = p_cnt-1
        if c_p_cnt == 0:
            print(0)
            continue
        r = (r0_m- pow(2, (N - 1 - i), c_p_cnt)) % c_p_cnt
    print(1 + solve(r % c_p_cnt))
n=int(input())
d=map(int,input().split())
d=list(d)
kotae=0
for i in range(n):
  for j in range(i+1,n):
    kotae=kotae+d[i]*d[i+j]
print(kotae)


### FIXED CODE ###

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

kotae=0
for i in range(n):
  for j in range(i+1,n):
    kotae=kotae+d[i]*d[j]
print(kotae)
n = int(input())
red =[]
for i in range(n):
  l = str(input())
  red.append(l)

m = int(input())
blue =[]
for i in range(m):
  l = str(input())
  blue.append(l)
  
import collections

cr = collections.Counter(red)
red_name = cr.most_common()[0][0]
red_count = cr.most_common()[0][1]
cb = collections.Counter(blue)
blue_name = cb.most_common()[0][0]
blue_count = cb.most_common()[0][1]

if blue_name == red_name:
  if red_count - blue_count < 0:
    if len(red)==1:
      print(0)
    else:
      print(cr.most_common()[1][1])
  else:
    print(red_count - blue_count)
else:
  print(red_count)

### FIXED CODE ###

n = int(input())
red =[]
for i in range(n):
  l = str(input())
  red.append(l)

m = int(input())
blue =[]
for i in range(m):
  l = str(input())
  blue.append(l)
  
import collections

cr = collections.Counter(red)
crs = list(cr.most_common())
cb = collections.Counter(blue)
cbs = list(cb.most_common())

result =[]

for i in range(len(cbs)):
  for j in range(len(crs)):
    if cbs[i][0]==crs[j][0]:
      result.append(crs[j][1]-cbs[i][1])
    else:
      flag = False
      count = 0
      for k in range(len(cbs)):
        if cbs[k].count(crs[j][0]) == 0:
          count+=1
      if count == len(cbs):
        result.append(crs[j][1])
        flag = False
        count = 0

if max(result)>0:
  print(max(result))
else:
  print(0)
a,b,c,d = input().split()

print(max((min(b,d)-max(a,c)),0))

### FIXED CODE ###

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

print(max((min(b,d)-max(a,c)),0))
n=int(input())
print(ceil(360/n))

### FIXED CODE ###

n=int(input())
k=1
while k>0:
  if k*n%360==0:
       print(k)
       break
  else:
       k+=1
N, M = map(int, input().split())

members = [-1] * N

group_count = 0
groups = [0] * N
group_dict = {}
for m in range(M):
    A, B = map(int, input().split())
    A = A - 1
    B = B - 1
    if members[A]==-1 and members[B]==-1:
        members[A] = members[B] = group_count
        groups[group_count] = 2
        group_dict[group_count] = [A, B]
        group_count += 1
    
    elif members[A]!=-1 and members[B]==-1:
        members[B] = members[A]
        groups[members[A]] += 1
        group_dict[members[A]].append(B)
    
    elif members[B]!=-1 and members[A]==-1:
        members[A] = members[B]
        groups[members[B]] += 1
        group_dict[members[B]].append(A)
    
    else:
        if members[A] != members[B]:
            if len(group_dict[A]) > len(group_dict[B]):
                old = members[B]
                groups[members[A]] += groups[members[B]]
                groups[members[B]] = 0
                group_dict[members[A]] = group_dict[members[A]] +  group_dict[members[B]]
                for aaaaaa in group_dict[members[B]]:
                    members[aaaaaa] = members[A]
                group_dict[old] = []
            else:
                old = members[A]
                groups[members[B]] += groups[members[B]]
                groups[members[A]] = 0
                group_dict[members[B]] = group_dict[members[B]] + group_dict[members[A]]
                for bbbbbb in group_dict[members[A]]:
                    members[bbbbbb] = members[B]
                group_dict[old] = []

ans = max(groups)
if ans == 0:
    print(1)
else:
    print(ans)

### FIXED CODE ###

class UnionFind:
    def __init__(self, N):
        self.parent = list(range(N))
        self.rank = [0] * N
        self.size = [1] * N

    def find(self, x):
        r = x
        while self.parent[r] != r:
            r = self.parent[r]
        while self.parent[x] != r:
            x, self.parent[x] = self.parent[x], r
        return r

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
            self.size[y] += self.size[x]
        else:
            self.parent[y] = x
            self.size[x] += self.size[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def get_size(self, x):
        return self.size[self.find(x)]

N, M = map(int, input().split())
uf = UnionFind(N)
for _ in range(M):
    A, B = map(int, input().split())
    uf.unite(A-1, B-1)

ans = max(uf.get_size(i) for i in range(N))
print(ans)