Harryxun/stf_run huggingface dataset:
N=int(input())
L=[[] for i in range(N)]
for i in range(N):
  M=int(input())
  L[i]=[list(map(int,input().split())) for j in range(M)]
#print(L)

L_2=[[i,None] for i in range(N)]
L_3=[0 for i in range(N)]
ans=0
for k in range(2**N):
	L_3=[0 for i in range(N)]
    Y_N=True
	count=0
	for a in range(N):
		if ((k >> a) & 1):  # 正直者のリストを作る
			L_3[a]=1
	for a in range(N):  # このループが一番のポイント
		if ((k >> a) & 1):  # 正直者のリスト
			count += 1
			for b in range(len(L[a])):
				if L_3[a] == 0: #もし正直者じゃないとされてたら
					Y_N=False #破綻
				person = L[a][b][0]-1
				if L_3[person]==1-L[a][b][1]: #すでに言われてることと矛盾
					Y_N=False #破綻
				L_3[person]=L[a][b][1] #証言の内容で人となりをアップデート
				#print(L_3,a,b)
	#print(L_3,count,Y_N)
	if Y_N:
		ans = max(ans, count)
print(ans)

### FIXED CODE ###

N=int(input())
L=[[] for i in range(N)]
for i in range(N):
  M=int(input())
  L[i]=[list(map(int,input().split())) for j in range(M)]
#print(L)

L_2=[[i,None] for i in range(N)]
L_3=[0 for i in range(N)]
ans=0
for k in range(2**N):
	L_3=[0 for i in range(N)]
	Y_N=True
	count=0
	for a in range(N):
		if ((k >> a) & 1):  # 正直者のリストを作る
			L_3[a]=1
	for a in range(N):  # このループが一番のポイント
		if ((k >> a) & 1):  # 正直者のリスト
			count += 1
			for b in range(len(L[a])):
				if L_3[a] == 0: #もし正直者じゃないとされてたら
					Y_N=False #破綻
				person = L[a][b][0]-1
				if L_3[person]==1-L[a][b][1]: #すでに言われてることと矛盾
					Y_N=False #破綻
				L_3[person]=L[a][b][1] #証言の内容で人となりをアップデート
				#print(L_3,a,b)
	#print(L_3,count,Y_N)
	if Y_N:
		ans = max(ans, count)
print(ans)
import math
X, Y = map(int, input().split())
r = 0
while X < Y:
  Y //= X
  r += 1
print(int(math.log2(r)) + 1)

### FIXED CODE ###

import math
X, Y = map(int, input().split())
r = 0
R = Y // X
while R >= 2:
  R //= 2
  r += 1
print(r + 1)
#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <19/May/2019 05:51:03 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT), Gwalior


import sys


def get_array(): return list(map(int, sys.stdin.readline().split()))


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


def input(): return sys.stdin.readline().strip()


def main():
    from math import log2
    n, k = get_ints()
    ans = 0
    for i in range(1, n + 1):
        curr = (1 / n)
        x = i
        while x < k:
            x *= 2
            curr *= (1 / 2)
        ans += curr
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <19/May/2019 05:51:38 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT), Gwalior


import sys


def get_array(): return list(map(int, sys.stdin.readline().split()))


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


def input(): return sys.stdin.readline().strip()


def main():
    #from math import log2
    n, k = get_ints()
    ans = 0
    for i in range(1, n + 1):
        curr = (1 / n)
        x = i
        while x < k:
            x *= 2
            curr *= (1 / 2)
        ans += curr
    print(ans)


if __name__ == "__main__":
    main()
count=0
n=int(input())
l=list(map(str,input()))
i=0
while i<=n-3:
    j=i+1
    while i+1<=j and j<=n-2:
        if l[i]==l[j]:
            j+=1
        else:
            k=j+1
            while j+1<=k and k<=n-1 and k-j!=j-i:
                if l[i]!=l[j] and l[j]!=l[k]:
                    count+=1
                    k+=1
                else:
                    k+=1
            j+=1
    i+=1
print(count)

### FIXED CODE ###

n=int(input())
if n%10==7:
    print('Yes')
elif 70<=n%100 and n%100<=79:
    print('Yes')
elif 700<=n and n<=799:
    print('Yes')
else:
    print('No')
a,b=int(input()),list(map(int,input().split()));b.sort();c=(b[0]+b[-1])//2;if (b[0]+b[-1])%2==1 and c+1 in b:c+=1
d=[(b[i]-c)**2 for i in range(a)];print(sum(d))

### FIXED CODE ###

a,b=int(input()),list(map(int,input().split()))
ans=-1
for i in range(-100,100+1):
  c=0
  for j in range(a):c+=(b[j]-i)**2
  if ans==-1:ans=c
  elif ans>c:ans=c
print(ans)
N = int(input())
l=list(map(int,input().split()))
ans=0
N_=int((N*(N-1))/2)
for i in range(N_-1):
  life=0
  for j in range(i+1,N_):
    life+=l[i]*l[j]
  ans+=life
print(ans)

### FIXED CODE ###

N = int(input())
l=list(map(int,input().split()))
ans=0
N_=int((N*(N-1))/2)
for i in range(N-1):
  life=0
  for j in range(i+1,N):
    life+=l[i]*l[j]
  ans+=life
print(ans)
from sys import setrecursionlimit; setrecursionlimit(10**9)
S = input()

def res(S, A, B):
    if not S:
        B.append(sum(list(map(int, A))))
        return None
    A += [S[0]]
    res(S[1:], A, B)
    A.pop()
    A[-1] += S[0]
    res(S[1:], A, B)
    return B

B = res(S[1:], [S[0]], [])
print(sum(B))

### FIXED CODE ###

from sys import setrecursionlimit; setrecursionlimit(10**9)
S = input()

def res(S, A, B):
    if not S:
        B.append(sum(list(map(int, A))))
        return None
    A += [S[0]]
    res(S[1:], A, B)
    A.pop()
    A[-1] += S[0]
    res(S[1:], A, B)
    return B

if len(S) == 1:
    print(int(S))
else:
    B = res(S[1:], [S[0]], [])
    print(sum(B))
from collections import defaultdict
d = defaultdict(int)
for _ in range(int(input())):
    d[input()] += 1
for _ in range(int(input())):
    d[input()] -= 1
print(max(0, d.values()))


### FIXED CODE ###

from collections import defaultdict
d1 = defaultdict(int)
d2 = defaultdict(int)
n = int(input())
for i in range(n):
    d1[input()] += 1
m = int(input())
for i in range(m):
    d2[input()] += 1

ans = 0
for k, v in d1.items():
    ans = max(ans, v - d2[k])
print(ans)
H, W, h, w = map(int, input().split())
if H % h == 0 and W % h == 0:
    print('No')
    exit()
rem = H * W - (H - H % h) * (W - W % w)
x = (H // h * W // w) // rem + 1
a = [[x] * W for _ in range(H)]
for i in range(h-1, H, h):
    for j in range(w-1, W, w):
        a[i][j] = -(h * w - 1) * x - 1
print('Yes')
for row in a:
    print(*row)


### FIXED CODE ###

H, W, h, w = map(int, input().split())
rem = H * W - (H - H % h) * (W - W % w)
if rem == 0:
    print('No')
    exit()
x = (H // h * W // w + rem) // rem
if abs(x) > 10**9 or abs(-(h * w - 1) * x - 1) > 10**9:
    print('No')
    exit()
print('Yes')
a = [[x] * W for _ in range(H)]
for i in range(h-1, H, h):
    for j in range(w-1, W, w):
        a[i][j] = -(h * w - 1) * x - 1
for row in a:
    print(*row)
s,c = map(int,input().split(" "))
     
counter = 0
if s >= 1 and c >= 2:
    temp = min(s,c//2)
    s -= temp
    c -= temp * 2
    counter += temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
    
if s<=0 and c >= 4:
    temp = c // 4
    counter += temp
    c -= temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
      
print(temp)


### FIXED CODE ###


n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)
N = int(input())
s = 0
for i in range(N):
  x, u = input().split()
  if u == "JPY":
    s += int(x)
  else:
    s += int(x) * 380000
print(s)

### FIXED CODE ###

N = int(input())
s = 0
for i in range(N):
  x, u = input().split()
  if u == "JPY":
    s += float(x)
  else:
    s += float(x) * 380000.0
print(s)
D = int(input())
print(f"Christmas {Eve*(25-D)}")

### FIXED CODE ###

D = int(input())
print("Christmas" + " Eve"*(25-D))
import numpy as np
from scipy.sparse.csgraph import connected_components
n,m,k=[int(i) for i in input().split()]

frends=np.zeros(shape=(n,n))
blocks=np.zeros(shape=(n,n))
for i in range(m):
    a,b=[int(j)-1 for j in input().split()]
    frends[a][b]=1
    frends[b][a]=1

for i in range(k):
    a,b=[int(j)-1 for j in input().split()]
    blocks[a][b]=1
    blocks[b][a]=1

l,labels=connected_components(frends)
labels
group=[np.array([0]*n) for i in range(l)]

group
labels=list(labels)
for i in range(n):
    group[labels[i]][i]=1

group_num=[0 for i in range(l)]
for i in range(n):
    group_num[labels[i]]+=1
group_num

def get_group_num(i):
    return group_num[labels[i]]

frends=np.ones((n,n))-frends
blocks=np.ones((n,n))-blocks

def get_frend_num(i):
    check=frends[i]*group[labels[i]]
    return int(sum(check)-1)
def get_block_num(i):
    check=blocks[i]*group[labels[i]]
    return int(sum(check)-1)


for i in range(n):
    frend_group_num=get_group_num(i)-1
    frend_num=get_frend_num(i)
    block_num=get_block_num(i)
    print(abs(frend_group_num-frend_num-block_num))
    

### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

import sys
sys.setrecursionlimit(10**9)
n,m,k=[int(i) for i in input().split()]
frends_num=[0 for i in range(n)]
def make_frends(m,n):
    data=[1 for i in range(m)]

    row=[]
    col=[]
    for k in range(m):
        i,j=[int(l) for l in input().split()]
        new_i=min(i,j)-1
        new_j=max(i,j)-1
        row.append(new_i)
        col.append(new_j)
        frends_num[new_i]+=1
        frends_num[new_j]+=1
    frend_sparce_matrix=csr_matrix((data, (row, col)),shape=(n,n))
    return frend_sparce_matrix


frends=make_frends(m,n)
l,labels=connected_components(frends)
labels
labels=list(labels)

class Group:
    def __init__(self,labels):
        self.labels=labels
        self.group_num=[0 for i in range(l)]
        for i in labels:
            self.group_num[i]+=1
    def get_group_num(self,i):
        return self.group_num[self.labels[i]]

group=Group(labels)


def get_frend_num(i):
    return frends_num[i]


def make_block(k,n):
    block_num=[0 for i in range(n)]
    for p in range(k):
        i,j =[int(l)-1 for l in input().split()]
        new_i=min(i,j)
        new_j=max(i,j)
        if labels[new_i]==labels[new_j]:
            block_num[i]+=1
            block_num[j]+=1
    return block_num

block=make_block(k,n)

def get_block_num(i):
    return block[i]

ans=[]
for i in range(n):
    ans.append(str(group.get_group_num(i)-1-get_frend_num(i)-get_block_num(i)))
print(" ".join(ans))
import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

import numpy as np

x = na()
for i, xi in enumerate(x):
    if xi==0:
        print(i+1)

### FIXED CODE ###

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

import numpy as np

x = na()
for i, xi in enumerate(x):
    if xi==0:
        print(i+1)
n,k = map(int,input().split())
x = list(map(int,input().split()))

kyori=2*10**8+1
for i in range(n-k+1):
#print(x[i:k+i])
  if x[k+i-1]<=0:
    kyori = min(kyori,abs(x[i]))
  elif x[i]<=0 and 0<=x[k+1-1]:
    kyori = min(kyori,abs(x[i]*2)+abs(x[k+i-1]),abs(x[i])+abs(x[k+i-1]*2))
  elif 0<=x[i]:
    kyori = min(kyori,abs(x[k+i-1]))
print(kyori)

### FIXED CODE ###

n,k = map(int,input().split())
x = list(map(int,input().split()))
 
kyori=10**9
for i in range(n-k+1):
#print(x[i:k+i])
  if x[k+i-1]<=0:
    kyori = min(kyori,abs(x[i]))
  elif x[i]<0 and 0<x[k+i-1]:
    kyori = min(kyori,abs(x[i]*2)+abs(x[k+i-1]),abs(x[i])+abs(x[k+i-1]*2))
  elif 0<=x[i]:
    kyori = min(kyori,abs(x[k+i-1]))
print(kyori)
N, M = map(int, input().split())
A = list(map(int, input().split()))

t = {}
c = 0
for a in A:
    c += a
    c %= M
    if c in t:
        t[c] += 1
    else:
        t[c] = 1

result = t[0]
c = 0
for a in A:
    c += a
    c %= M
    t[c] -= 1
    result += t[c]
print(result)


### FIXED CODE ###

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

t = {}
c = 0
for a in A:
    c += a
    c %= M
    if c in t:
        t[c] += 1
    else:
        t[c] = 1

result = 0
if 0 in t:
    result += t[0]
c = 0
for a in A:
    c += a
    c %= M
    t[c] -= 1
    result += t[c]
print(result)
import sys
heights = sorted([ int(h) for h in sys.stdin],reverce)
for h in heights:
    print(h)

### FIXED CODE ###

import sys
heights = sorted([ int(h) for h in sys.stdin ], reverse=True)
print( heights[0] )
print( heights[1] )
print( heights[2] )
n = int(input())
s = input()
c = 0
sl = list(s)
sl2 = sl
k = 0
for i in range(n-2):
   if sl[i]=="#" and sl[i+1]==".":
      if sl[i+2]==".":
        sl[i]='.'
        c = c + 1
      elif sl[i+2]=='#':
        sl[i+1]='#'
        c = c + 1
      #if c == 1:
       # k = i
if sl[n-2]=="#" and sl[n-1]==".":
  sl[i+1]='#'
  c=c+1
print(c)

### FIXED CODE ###

n = int(input())
s = input()
m = s.count('.')
ans = m
for i in range(n):
  if s[i] == '#':
    m = m + 1
  else:
    m = m - 1
  ans=min(m,ans)
print(ans)
n = int(input())
a = [int(i) for i in input().split()]

if n < 10:
    d = a.copy()

    for i in range(1, n // 2):
        b = [0] * n
        c = -10 ** 24
        ans = -10 ** 24
        for j in range(i * 2, n):
            c = max(c, a[j - 2])
            b[j] = c + d[j]
            ans = max(ans, c + d[j])

        a = b.copy()
    print(ans)
    exit()
    
b = a[:4]
e = [True]*4

for i in range(1, n // 2):
    c = [0] * 4
    f = [False]*4
    d = -10**24
    for j in range(4):
        if 2 * i + j >= n:
            continue
        if not e[j]:
            continue
        d = max(d, b[j])
        c[j] = d + a[2 * i + j]
        f[j] = True
    e = f.copy()
    b = c.copy()
ans = -10 ** 24
for i in range(4):
    if e[i]:
        ans = max(ans, b[i])
print(e)
print(ans)


### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]

if n // 2 == 1:
    print(max(a))
    exit()
if n < 20:
    d = a.copy()
    
    for i in range(1, n // 2):
        b = [0] * n
        c = -10 ** 24
        ans = -10 ** 24
        for j in range(i * 2, n):
            c = max(c, a[j - 2])
            b[j] = c + d[j]
            ans = max(ans, c + d[j])

        a = b.copy()
    print(ans)
    exit()

b = a[:10]
e = [True]*10

for i in range(1, n // 2):
    c = [0] * 10
    f = [False]*10
    d = -10**24
    for j in range(10):
        if 2 * i + j >= n:
            continue
        if not e[j]:
            continue
        d = max(d, b[j])
        c[j] = d + a[2 * i + j]
        f[j] = True
    e = f.copy()
    b = c.copy()
ans = -10 ** 24
for i in range(10):
    if e[i]:
        ans = max(ans, b[i])
print(ans)
a,b=map(int,input())
sm=a+b,
sb=a-b
tms=a*b
mx=max(sm,sb,tms)
print(mx)

### FIXED CODE ###

a,b=map(int,input().split( ))
sm=a+b
sb=a-b
tms=a*b
mx=max(sm,sb,tms)
print(mx)
from collections import deque
H, W = map(int, input().split())

area = [input() for _ in range(H)]

distance = [ [float('inf') for _ in range(W)] for _ in range(H)]
to_search = deque()

for i in range(H):
    for j in range(W):
        if area[i][j] == "#":
            to_search.appendleft((i, j, 0))
            distance[i][j] = 0

didj = [[1, 0], [0. 1], [-1, 0], [0, -1]]
ans = 0

while len(to_search) > 0:
    nowi, nowj, nowd = to_search.pop()
    for di, dj in didj:
        nexti = nowi + di
        nextj = nowj + dj
        if 0 <= nexti <= H and 0 <= nextj <= W:
            if distance[nexti][nextj] > nowd + 1:
                to_search.appendleft((nexti, nextj, nowd + 1))
                distance[nexti][nextj] = nowd + 1
                ans = max(ans, nowd + 1)

print(ans)


### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())

area = [input() for _ in range(H)]

distance = [ [float('inf') for _ in range(W)] for _ in range(H)]
to_search = deque()

for i in range(H):
    for j in range(W):
        if area[i][j] == "#":
            to_search.appendleft((i, j, 0))
            distance[i][j] = 0

didj = [[1, 0], [0, 1], [-1, 0], [0, -1]]
ans = 0

while len(to_search) > 0:
    nowi, nowj, nowd = to_search.pop()
    for di, dj in didj:
        nexti = nowi + di
        nextj = nowj + dj
        if 0 <= nexti < H and 0 <= nextj < W:
            if distance[nexti][nextj] > nowd + 1:
                to_search.appendleft((nexti, nextj, nowd + 1))
                distance[nexti][nextj] = nowd + 1
                ans = max(ans, nowd + 1)

print(ans)
from collections import deque
n, m, k = map(int, input().split())
a = deque(list(map(int, input().split())))
b = deque(list(map(int, input().split())))

time = 0
count = 0
while len(a) > 0 or len(b) > 0:
    if len(a) ==  0:
        book_b = b.popleft()
        time += book_b
        count += 1
    elif len(b) == 0:
        book_a = a.popleft()
        time += book_a
        count+= 1
    elif a[0] > b[0]:
        book_b = b.popleft()
        time += book_b
        count += 1
    elif a[0] == b[0]:
        if a[1] > b[1]:
            book_b = b.popleft()
            time += book_b
            count += 1
        else:
            book_a = a.popleft()
            time += book_a
            count += 1            
    else:
        book_a = a.popleft()
        time += book_a
        count += 1
    if time > k:
        count -= 1
        break

    
print(count)   

    


### FIXED CODE ###

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
book_a = [0] * (n + 1)
book_b = [0] * (m + 1)

for i in range(n):
    book_a[i+1] = book_a[i] + a[i]

for j in range(m):
    book_b[j + 1] = book_b[j] + b[j]

r = m
ans = 0

for i in range(n + 1):
    if book_a[i] > k:
        break
    while book_a[i] + book_b[r] > k:
        r -= 1
    ans = max(ans, i + r)

print(ans)
[n,x]=[int(x) for x in input().split()]
l=[int(x) for x in input().split()]
k=0
count=0
for i in range(n+1):
  if k<=x:
    count+=1
  k+=l[i]
print(count)

### FIXED CODE ###

[n,x]=[int(i) for i in input().split()]
l=[int(x) for x in input().split()]
a=1
su=0

for i in l:
    
    if su>x:
        
        break
    su+=i
    if su<=x:
        a+=1
   

print(a)
n, w = map(int, input().split())

values = [0]
weights = [0]
for i in range(n):
    value, weight = map(int, input().split())
    values.append(value)
    weights.append(weight)

dp = [[0 for i in range(w + 1)] for j in range(len(values) + 1)]

for i in range(len(values)):
    for j in range(w + 1):
        if weights[i] <= j:
            dp[i + 1][j] = max(dp[i][j - weights[i]] + values[i], dp[i][j])
        else:
            dp[i + 1][j] = dp[i][j]

print(dp[n][w + 1])



### FIXED CODE ###

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

values = []
weights = []
for i in range(n):
    value, weight = map(int, input().split())
    values.append(value)
    weights.append(weight)

dp = [[0 for i in range(w + 1)] for j in range(n + 1)]

for i in range(n):
    for j in range(w + 1):
        if weights[i] <= j:
            dp[i + 1][j] = max(dp[i][j - weights[i]] + values[i], dp[i][j])
        else:
            dp[i + 1][j] = dp[i][j]

print(dp[n][w])
from collections import Counter

class UnionFind():
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n
        
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
            
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            

N, M = map(int, input().split())
UF = UnionFind(N)
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    big = max(a, b)
    small = min(a, b)
    
    if UF.par[big] == big:
        UF.par[big] = small
    else:
        UF.union(big, small)

for i in range(N):
    UF.find(i)
    
c = Counter(UF.par)

if len(c.values()) == 1:
    print(n)
else:
    print(max(c.values()))

### FIXED CODE ###

from collections import Counter

class UnionFind():
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n
    
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
                
n, m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.union(a, b)

for i in range(n):
    uf.find(i)

c = Counter(uf.par)
print(max(c.values()))
n,x = input().split()
n,x = int(n), int(x)
L = [int(x) for x in input().split()]

D = [0 for _ in range(N)]

for i in range(1, N):
  D[i] = D[i-1] + L[i-1]

res = [True if D[i] <= x else False for i in range(N)]

print(sum(res))

### FIXED CODE ###

n,x = input().split()
n,x = int(n), int(x)
L = [int(x) for x in input().split()]

D = [0 for _ in range(n + 1)]

for i in range(1, n + 1):
  D[i] = D[i-1] + L[i-1]

res = [True if D[i] <= x else False for i in range(n + 1)]

print(sum(res))
N=int(input())
T=int(input())
gcd=100000000000000000000000
for i in range(N-1):
    T1=int(input())
    A=max(T,T1)
    B=min(T,T1)
    for j in range(1000000000000):
        
        if A%B==0:
            gcd=B
            
            break
        else:
            C=A%B
            if C>B:
                A=C
            else:
                B=C
print(T1*T/gcd)
            


### FIXED CODE ###

import fractions
N=int(input())
LCM=int(input())
for i in range(N-1):
    T=int(input())
    LCM=LCM*T//fractions.gcd(LCM,T)
print(LCM)
N = int(input())
A = list(map(int, input().split()))

X = [-1, -1, -1]
ans = 1
for a in A:
    t = X.count(a-1)
    ans = ans * t % 1000000007
    idx = X.index(a-1)
    if idx < 0:
        print(0)
        exit()
    X[idx] += 1
print(ans)


### FIXED CODE ###

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

X = [-1, -1, -1]
ans = 1
for a in A:
    t = X.count(a-1)
    ans = ans * t % 1000000007
    if a-1 not in X:
        print(0)
        exit()
    idx = X.index(a-1)
    X[idx] += 1
print(ans)
if a < b:
	if a < c:
		if b < c:
			print(a < b < c)
		else:
			print("a < c < b")
	else:
		print("c < a < b")
elif a > b:
	if a > c:
		if b < c:
			print("b < c < a")
		else:
			print("c < b < a")
	else:
		print("b < c < a")

### FIXED CODE ###

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

num.sort()

print(num[0], num[1], num[2])
N, M = map(int, input().split())
L_list = []
R_list = []

for i in range(M):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)

print(L - R + 1)

### FIXED CODE ###

N, M = map(int, input().split())
L = 0
R = N
for i in range(M):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)

print(max(0, R - L + 1))
def answer(s):
    YES = 'YES'
    NO = 'NO'
    dic = collections.Counter(s)
    vals = sorted([v for k,v in dic.items()], reverse=True)
    if len(vals) == 1: return YES
    elif len(vals) == 2:
        if vals[0] == 1 and vals[1] == 1: return YES
        else: return NO
    
    _max = vals[0]
    _sum = sum(vals[1:])
    if (_max-1)*2 <= _sum:
        if vals[1]-vals[2] > 1: return NO
        else: return YES
    return NO
s = input()
print(answer(s))

### FIXED CODE ###

import collections

def answer(s):
    YES = 'YES'
    NO = 'NO'
    dic = collections.Counter(s)
    vals = sorted([v for k,v in dic.items()], reverse=True)
    if len(vals) == 1:
        if vals[0] == 1: return YES
        else: return NO
    elif len(vals) == 2:
        if vals[0] == 1 and vals[1] == 1: return YES
        else: return NO
    
    _max = vals[0]
    _sum = sum(vals[1:])
    if (_max-1)*2 <= _sum:
        if vals[1]-vals[2] > 1: return NO
        else: return YES
    return NO

s = input()
print(answer(s))