Harryxun/stf_run huggingface dataset:
#input
r_1, c_1, r_2, c_2 = map(int, input().split())

#output
mod = 10**9 + 7

n_ = 10**6 + 3
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod
def cmb(n,r):
    if n <= 0 or r < 0 or r > n: return 0
    return fun[n]*rev[r]%mod*rev[n-r]%mod

answer = 0
for j in range(c_1, c_2+1):
    answer += cmb(r_2+j+1, j+1) % mod - cmb(r_1+j, j+1) % mod

print(answer % mod)

### FIXED CODE ###

#input
r_1, c_1, r_2, c_2 = map(int, input().split())

#output
mod = 10**9 + 7

n_ = 2*10**6 + 1
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod
def cmb(n,r):
    if n <= 0 or r < 0 or r > n: return 0
    return fun[n]*rev[r]%mod*rev[n-r]%mod

answer = 0
for j in range(c_1, c_2+1):
    answer += cmb(r_2+j+1, j+1) % mod - cmb(r_1+j, j+1) % mod

print(answer % mod)
#!/usr/bin/env python3
import sys
import math

MOD = 1000000007  # type: int
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def solve(N: int, K: int):
    re = N-K

    for i in range(1,K+1):
        split_pattern = combinations_count(K-1,i-1)
        print(math.factorial(split_pattern)*combinations_count(re+1,i)%MOD)
        
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import math

MOD = 1000000007  # type: int
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def solve(N: int, K: int):
    for i in range(1,K+1):
        split_pattern = combinations_count(K-1,i-1)
        if N-K >= i-1:
            print((split_pattern*combinations_count(N-K+1,i))%MOD)
        else:
            print(0)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()
n=input()
A=input()
B=input()
C=input()

As=map(int,A.split(' '))
Bs=map(int,B.split(' '))
Cs=map(int,C.split(' '))
total=0
for i in range(0,n):
    if As[i]-As[i-1]==1 and i!=0:
        total=total+Cs[As[i]]
    else:
        total=total+Bs[As[i]]
print(total)

### FIXED CODE ###

n=int(input())
A=input()
B=input()
C=input()

As=list(map(int,A.split(' ')))
Bs=list(map(int,B.split(' ')))
Cs=list(map(int,C.split(' ')))
total=0
for i in range(0,n):
    if As[i]-As[i-1]==1 and i!=0:
        total=total+Cs[As[i]-2]
    total=total+Bs[As[i]-1]
print(total)
import Counter
n=int(input())
a=list(map(int,input().split()))
cnt=0
c=Counter(a)
for u,v in c:
  if int(u)>v:
    cnt+=v
  else:
    cnt+=v-int(u)
print(cnt)

### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
cnt=0
c=Counter(a)
for u in c.keys():
  if int(u)>c[u]:
    cnt+=c[u]
  else:
    cnt+=c[u]-int(u)
print(cnt)
A1 = int(input())
A2 = int(input())
A3 = int(input())
sum  = A1+A2+A3
if(sum>=22):
    print("bust")
else:
    print("win")

### FIXED CODE ###

a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")
N = int(input())
X = input()
def popcount(k):
    return bin(k).count('1')

K = int(X, 2)
one = popcount(K)
K_MOD   = K % one
K_MOD_M = K % (one-1)
K_MOD_P = K % (one+1)
#memo = [-1] * (N+1)
#print('k_mod_m=', K_MOD_M)
#print('k_mod_p=', K_MOD_P)
T = 2**(N-1)
for i in range(N):
    if X[i] == '1':
        pop = one - 1
        k = K_MOD_M - T
    else:
        pop = one + 1
        k = K_MOD_P + T
    T //= 2

    if pop == 0:
        print(0)
    else:
        k %= pop
        pop = popcount(k)
        #key = k
        cnt = 1
        while k > 0:
            #print('  ', k, pop, cnt)
            #if memo[key] > 0:
            #    cnt += memo[k]
            #    break
            #else:
            k %= pop
            pop = popcount(k)
            cnt += 1
        #memo[key] = cnt
        print(cnt)


### FIXED CODE ###

N = int(input())
X = input()
memo = [-1] * (N+1)
memo[0] = 0

def popcount(k):
    return bin(k).count('1')

def calc(k):
    pop = popcount(k)
    #print('  ', k, pop)
    key = k
    if memo[key] < 0:
        k %= pop
        if k == 0:
            memo[key] = 1
        else:
            memo[key] = calc(k) + 1
    return memo[key]

K = int(X, 2)
one = popcount(K)
if one == 0:
    K_MOD = K
elif one == 1:
    K_MOD   = 0
    K_MOD_M = K
else:
    K_MOD   = K % one
    K_MOD_M = K % (one-1)
K_MOD_P = K % (one+1)

T_M = [1]*(N+1)
T_P = [1]*(N+1)
for i in range(1,N+1):
    if one > 1:
        T_M[i] = (T_M[i-1]*2) % (one-1)
    T_P[i] = (T_P[i-1]*2) % (one+1)

for i in range(N):
    if X[i] == '1':
        pop = one - 1
        k = K_MOD_M - T_M[N-i-1]
    else:
        pop = one + 1
        k = K_MOD_P + T_P[N-i-1]

    if pop == 0:
        print(0)
    else:
        k %= pop
        print(calc(k)+1)
def dfs(dp,edges,node,visited):
    if node not in visited:
        visited.add(node)
        for kid in edges[node]:
            dfs(dp,edges,kid,visited)
            #print(dp,node,kid)
            dp[node-1] = max(dp[node-1],dp[kid-1])
        if edges[node]:
            dp[node-1] += 1

def solve(edges,n):
    dp = [0]*n
    visited = set()
    for i in range(1,n+1):
        if i not in visited:
            #print(i)
            dfs(dp,edges,i,visited)

    #print(dp)
    print(max(dp))

def main():
    n,m = map(int,input().split())
    edges = {}
    for i in range(1,n+1):
        edges[i] = []

    for i in range(m):
        x,y = map(int,input().split())
        edges[x].append(y)

    solve(edges,n)


main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def dfs(dp,edges,node,visited):
    if node not in visited:
        visited.add(node)
        for kid in edges[node]:
            dfs(dp,edges,kid,visited)
            #print(dp,node,kid)
            dp[node-1] = max(dp[node-1],dp[kid-1])
        if edges[node]:
            dp[node-1] += 1

def solve(edges,n):
    dp = [0]*n
    visited = set()
    for i in range(1,n+1):
        if i not in visited:
            #print(i)
            dfs(dp,edges,i,visited)

    #print(dp)
    print(max(dp))

def main():
    n,m = map(int,input().split())
    edges = {}
    for i in range(1,n+1):
        edges[i] = []

    for i in range(m):
        x,y = map(int,input().split())
        edges[x].append(y)

    solve(edges,n)


main()
def input(): return sys.stdin.readline().strip()
st = input()
q = int(input())
for i in range(q):
    ipt = input()
    if ipt == "1":
        st = st[::-1]
    else:
        _, f, c = input().split()
        if f == "1":
            st = st + c
        else:
            st = c + st
print(st)


### FIXED CODE ###

#!/usr/bin/env python3
s, _, *q = open(0)
g = ""
s = s.strip()
for q in q:
  q = q.strip().split()
  if q[0] == "1":
    g, s = s, g
  else:
    if q[1] == "1":
      g += q[2]
    else:
      s += q[2]
print(g[::-1] + s)
A, B, C = map(int,input().split())

for i in range(B):
  if A * i % B == C:
    print("YES")
    flag = True
    exit()
  else:
    continue

if flag != True:
  print("NO")


### FIXED CODE ###

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

for i in range(B):
  if A * i % B == C:
    print("YES")
    exit()
  else:
    continue
print("NO")
print(list(input).count(1))

### FIXED CODE ###

print(list(input()).count('1'))
A,B = map(int,input().split())
C,D = map(int,input().split())
count = 0
for i in range(A,B+1):
  if i%C != 0 and i%D != 0:
    count += 1
    i += 1
  else:
    i += 1
    break
print(count)

### FIXED CODE ###

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

A,B,C,D = map(int,input().split())
all_count = B-A+1
c_count = B//C - (A-1)//C
d_count = B//D - (A-1)//D
cd_count = B//lcm(C,D) - (A-1)//lcm(C,D)
ans = all_count - c_count - d_count + cd_count
print(ans)
import sys
A,B = map(int,input().split())
plug = 1
socket = 0
while True:
  new_plug += A
  socket += 1
  if new_plug >= B:
    print(socket)
    sys.exit(0)

### FIXED CODE ###

import sys
A,B = map(int,input().split())
plug = 1
socket = 0
while True:
  if plug >= B:
    print(socket)
    sys.exit(0)
  plug += A
  socket += 1
  plug -= 1
a,b,c,d=[x for x in input()]
op='+-'
for op1 in op:
  for op2 in op:
    for op3 in op:
      ans=A+op1+B+op2+C+op3+D
      if eval(ans)==7:
        print('{}=7'.format(ans))
        exit()
      else:
        pass

### FIXED CODE ###

import sys
a,b,c,d=[x for x in input()]
op='+-'
for op1 in op:
  for op2 in op:
    for op3 in op:
      ans=a+op1+b+op2+c+op3+d
      if eval(ans)==7:
        print('{}=7'.format(ans))
        sys.exit()
      else:
        pass
S = input()
T = input()

if (T[:-1] == S) && ( len(S) = len(T) - 1):
  return "Yes"
else:
  return "No"


### FIXED CODE ###

S = input()
T = input()

if (T[:-1] == S) and (len(S) + 1 == len(T)):
  print("Yes")
else:
  print("No")
opt = 0
    gt = 2*(10**9)**2+1
    for j in range(l,r+1):
        for i in range(l,j):
            opt = (i * j) % 2019
            if gt > opt:
                gt = opt
    return gt
if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)

### FIXED CODE ###

def remainder_min(l,r):
    sml = 2*(10**9)**2+1
    _r = min(r,l+2019)
    for i in range(l,_r):
        for j in range(i+1,_r+1):
            num = i * j
            rem = num % 2019
            if rem == 0:
                return 0
            sml = min(sml,rem)
    return sml

if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)
import sys

H, W, M = map(int, input().split())
hw = [list(map(int, input().split())) for _ in range(M)]

hw.sort()

hcnt = [0] * (H+1)
wcnt = [0] * (W+1)

target = []
for i, j in hw:
    hcnt[i] += 1
    wcnt[j] += 1
    target.append([str(i) + " " + str(j),1])

d = dict(target)

hlist = []
hmax = -1
for i in range(1,H+1):
    if hmax < hcnt[i]:
        hlist = [i]
        hmax = hcnt[i]
    elif hmax == hcnt[i]:
        hlist.append(i)

wlist = []
wmax = -1
for i in range(1,W+1):
    if wmax < wcnt[i]:
        wlist = [i]
        wmax = wcnt[i]
    elif wmax == wcnt[i]:
        wlist.append(i)

if len(hlist) * len(wlist) > M:
    print(hmax + wmax)
    sys.exit()

idx = 0
for h in hlist:
    for w in wlist:
        while h > hw[idx][0] or w > hw[idx][1]:
            idx += 1
            if h == hw[idx][0] and w == hw[idx][1]:
                break
        if h < hw[idx][0] or w < hw[idx][1]:
            print(hmax + wmax)
            sys.exit()
        
print(hmax + wmax - 1)

### FIXED CODE ###

import sys

H, W, M = map(int, input().split())
hw = [list(map(int, input().split())) for _ in range(M)]

hw.sort()

hcnt = [0] * (H+1)
wcnt = [0] * (W+1)

target = []
for i, j in hw:
    hcnt[i] += 1
    wcnt[j] += 1
    target.append([str(i) + " " + str(j),1])

d = dict(target)

hlist = []
hmax = -1
for i in range(1,H+1):
    if hmax < hcnt[i]:
        hlist = [i]
        hmax = hcnt[i]
    elif hmax == hcnt[i]:
        hlist.append(i)

wlist = []
wmax = -1
for i in range(1,W+1):
    if wmax < wcnt[i]:
        wlist = [i]
        wmax = wcnt[i]
    elif wmax == wcnt[i]:
        wlist.append(i)

if len(hlist) * len(wlist) > M:
    print(hmax + wmax)
    sys.exit()

idx = 0
for h in hlist:
    for w in wlist:
        while h > hw[idx][0] or w > hw[idx][1]:
            idx += 1
            if idx == M:
                print(hmax + wmax)
                sys.exit()                
            if h == hw[idx][0] and w == hw[idx][1]:
                break
        if h < hw[idx][0] or w < hw[idx][1]:
            print(hmax + wmax)
            sys.exit()
        
print(hmax + wmax - 1)
N=int(input())
para = [int(input()) for i in range(N)]
para.sort(reverse=True)

"""
全ての最小公倍数を求めたら良い
lcm(a,b,c...) = lcm(a,lcm(b,c.......))
gcd(a,b,c...) = gcd(a,gcd(b,c,d....))
"""

"""
最大公倍数の実装
ユークリッドの互除法
a = b*c + d
c = d*e + f
"""
def gcd(a,b):
    if b == 0 : 
        return a  
    return gcd(b,a%b)

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

for i in range(N-1,0,-1):
    if i == N-1:
        p = lcm(para[i-1],para[i])
    else :
        p = lcm(para[i],p)
print(p)

### FIXED CODE ###

N=int(input())
para = [int(input()) for i in range(N)]
para.sort(reverse=True)


def gcd(a,b):
    if b == 0 : 
        return a  
    return gcd(b,a%b)

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

for i in range(N-1,-1,-1):
    if i == N-1:
        p = lcm(para[i-1],para[i])
    else :
        a = max(para[i],p)
        b = min(para[i],p)
        p = lcm(a,b)
print(p)
import math
n = int(input())
lis = list(map(int,input().split()))
for i in range(n):lis[-(i+1)] += i
lis.sort()
cou = 0
co = 0
num = lis[math.ceil(n/2)]
nu = lis[math.floor(n/2)]
for i in range(n):
  cou += abs(lis[i]-num)
  co += abs(lis[i]-nu)
print(min(cou,co))

### FIXED CODE ###

import math
n = int(input())
lis = list(map(int,input().split()))
if n == 1:
  print("0")
  exit()
for i in range(n):lis[-(i+1)] += i
lis.sort()
cou = 0
co = 0
num = lis[math.ceil(n/2)]
nu = lis[math.floor(n/2)]
for i in range(n):
  cou += abs(lis[i]-num)
  co += abs(lis[i]-nu)
print(min(cou,co))
N=input()
a
if N[0] ='S':
  a='Cloudy'
elif N[0] ='C':
  a='Rainy'
else:
  a='Sunny'

ptint(a)
  

### FIXED CODE ###

N=input()
a=''
if N[0] =='S':
  a='Cloudy'
elif N[0] =='C':
  a='Rainy'
else:
  a='Sunny'

print(a)
N = int(input())
G = [[]] * N
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1
    G[u].append((v, w))
    G[v].append((u, w))

C = [-1 for _ in range(N)]


def dfs(pos, color):
    for e in G[pos]:
        if C[e[0]] != -1:
            continue
        # odd
        if e[1] & 1:
            c = 1 - color
            C[e[0]] = c
            dfs(e[0], c)
        # even
        else:
            c = color
            C[e[0]] = c
            dfs(e[0], c)


C[0] = 0
dfs(0, 0)
for i in range(N):
    print(C[i])


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N = int(input())
G = [[] for _ in range(N)]
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1
    G[u].append((v, w))
    G[v].append((u, w))

C = [-1 for _ in range(N)]


def dfs(pos, color):
    C[pos] = color
    for e in G[pos]:
        if C[e[0]] != -1:
            continue
        # odd
        if e[1] & 1:
            c = 1 - color
            dfs(e[0], c)
        # even
        else:
            c = color
            dfs(e[0], c)


dfs(0, 0)
for i in range(N):
    print(C[i])
h = list(map(int, input().split()))
ans = 0
while sum(h) != 0:
    left = float("inf")
    right = float("inf")
    for i in range(n):
        if h[i] > 0:
            left = i
            break
    for j in range(i + 1, n):
        if h[j] <= 0:
            right = j
            break
    if right == float("inf"):
        right = n
    for i in range(left, right):
        h[i] -= 1
    ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
ans = 0
while sum(h) != 0:
    left = float("inf")
    right = float("inf")
    for i in range(n):
        if h[i] > 0:
            left = i
            break
    for j in range(i + 1, n):
        if h[j] <= 0:
            right = j
            break
    if right == float("inf"):
        right = n
    for i in range(left, right):
        h[i] -= 1
    ans += 1
print(ans)
a. b. x = map(int, input().split())
def f(x):
  return (a*x)//b - a*(x//b)

print(f(min(b-1, n))

### FIXED CODE ###

a, b, n = map(int, input().split())
def f(x):
  return (a*x)//b - a*(x//b)
 
print(f(min(b-1, n)))
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]
a = np.array(A)
sum = np.prod(a)

if  sum > 1000000000000000000:
    print(-1)
else:
    print(sum)


### FIXED CODE ###

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

N = int(in_list[0])
Y = int(in_list[1])

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

get_answer_flg = 0
for k in range(z+1):
    if get_answer_flg==1:
        break;
    else:
        res_y_i = Y - k*1000
        # print('res_y_first：', res_y_i)
        for j in range(y+1):
            res_y_j = res_y_i - j*5000
            i = res_y_j/10000
            # print('res_y_second：', res_y_j)
            # print('j：', j)
            # print('i：', i)
            if i<0:
                break;
            elif i == 0:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;
            elif i>0 and i.is_integer() and (i+j+k)<=N:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;

if get_answer_flg==0:
    print('-1 -1 -1')

del in_list

### FIXED CODE ###

S = input().split('/')

S[0] = '2018'

print('/'.join(S))
n = int(input())
a = map(int,raw_input().split())
p = int(input())
m = map(int,raw_input().split())
def goukei(i,m):
  if m ==0:
    return True
  if i >= n or m > sum(a):
    return False
  r = goukei(i + 1, m) or goukei(i + 1, m - a[i])
  return r
 
for u in range(0,p):

  if s(0, m[u]):
    print "yes"
  else:
    print "no"
   
  
  
  
  
  
  
  

### FIXED CODE ###

n = int(input())
a = map(int,raw_input().split())
p = int(input())
m = map(int,raw_input().split())
def goukei(i,m):
  if m ==0:
    return True
  if i >= n or m > sum(a):
    return False
  r = goukei(i + 1, m) or goukei(i + 1, m - a[i])
  return r
 
for u in range(0,p):

  if goukei(0, m[u]):
    print "yes"
  else:
    print "no"
S=input()
tmp=[]
for i in range(len(S)-2):
  tmp.append(S[i:i+2])
for j in range(len(tmp)):
  tmp[i]=abs(753-int(tmp[i]))
print(min(tmp))

### FIXED CODE ###

S = input()
tmp = []
for i in range(len(S)-2):
    tmp.append(S[i:i+3])
for j in range(len(S)-2):
    tmp[j] = abs(753-int(tmp[j]))
print(min(tmp))
x[] = input().split()
a = b = c = 1
for i in 3:
    if x[i] == 'a':
        a--;
    elif x[i] == 'b':
        b--;
    else:
        c--;
if a == 0 and b == 0 and c == 0: 
    print("Yes")
else:
    print("No")

### FIXED CODE ###

x = input()
a = b = c = 1
for i in range(3):
    if x[i] == 'a':
        a -= 1
    elif x[i] == 'b':
        b -= 1
    else:
        c -= 1
if a == 0 and b == 0 and c == 0: 
    print("Yes")
else:
    print("No")
a=input()
x=2
y=1
for i in range(a-1):
    z=x+y
    x=y
    y=z

z=str(z)
print z

### FIXED CODE ###

a=input()
x=2
y=1
z=1
for i in range(a-1):
    z=x+y
    x=y
    y=z

z=str(z)
print z
num=input()
num_list=list(num)
n=len(num)
ans_num=0
element=num_list[0]
while True:
    tf=True
    for i in range(n):
        if element<num_list[i]:
            tf=False
            element+=1
            break
    if tf:
        ans_num=element
        break
print(ans_num*element)

### FIXED CODE ###

num=input()
num_list=list(num)
n=len(num)
ans_num=0
element=int(num_list[0])
for i in range(n):
    if element<int(num_list[i]):
        tf=False
        element+=1
        break
print(str(element)*n)
MOD = 10**9+7
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
# print(A)

factorial = [0] * (N+2)

def fact(n, MOD=MOD):
    global factorial
    if n == 0:
        factorial[n] = 1
        return 1
    res = n * fact(n-1)
    res %= MOD
    factorial[n] = res
    return res

fact(N+1)
# print(fact(N, MOD))
# print(factorial)

def nCr(n, r, mod=10**9+7):
    res = factorial[n]
    res //= factorial[r]
    res //= factorial[n-r]
    res %= MOD
    return res

# # フェルマーの小定理
# def nCr(n, r, mod=10**9+7):
#     r = min(r, n-r)
#     numer = denom = 1
#     for i in range(1, r+1):
#         numer = numer * (n+1-i) % mod
#         denom = denom * i % mod
#     return numer * pow(denom, mod-2, mod) % mod

ans = 0
for i in range(K+1):
    c = nCr(i+K-1, i)
    ans += c * A[N-K-1+i]
    ans -= c * A[K-i]
    ans %= MOD
ans %= MOD
print(ans)


### FIXED CODE ###

mod = 10**9+7
f = [1]
for i in range(10**5+7):
    f.append(f[-1]*(i+1)%mod)

def comb(n, r,mod=mod):
    return f[n] * pow(f[r], mod-2, mod) * pow(f[n-r], mod-2, mod) % mod

n, k = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)

ans = 0
for i in range(n-k+1):
    ans += (a[i] - a[-1-i]) * comb(n-1-i, k-1)
    ans %= mod
print(ans)
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
    elif i=0:
        s=0
print(s)

### FIXED CODE ###

N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)
import numpy as np
n,d=map(int,input().split())
x=[]

def dist(x,y):
  diff=x-y
  diff_sq=np.square(diff)
  return(np.sqrt(np.sum(diff_sq)))

ans=0
for N in range(n):
    for i in range(N,n):
        X = distance(x[N], x[i])
 
        if X.is_integer():
            ans += 1
 
print(ans)

### FIXED CODE ###

import numpy as np
def is_square(n):
    for i in range(200):
        if i*i == n:
            return True
    return False
n,d = map(int, input().split())
x = []
for i in range(n):
    x.append(list(map(int,input().split())))

x = np.array(x)

count = 0
for i in range(n):
    for j in range(i+1,n):
        l = x[i] - x[j]
        l = np.square(l)
        l = np.sum(l)
        flag = is_square(l)
        if(flag) :
            count +=1

print(count)
n,q=map(int,input().split())
s=list(input())
#print(s)
i=0
a=[]
x=0
while i!=len(s)-1:
 #if n<10000:

    if s[i]=="C" and a1==1:
        x=x+1
        a1=0
    elif s[i]=="A":
        a1=1
    else:
        a1=0
    i=i+1
    a.append(x)

#print(a)
i=0
while i!=q:
  try:
    l,r=map(int,input().split())
    i=i+1
    s=a[r-2]-a[l-1]
    print(s)
  except:
      break

### FIXED CODE ###

n,q=map(int,input().split())
s=list(input())
#print(s)
i=1
a=[0]
x=0
while i!=n:
    if s[i-1]=="A":
        if s[i]=="C":
            x=x+1
    i=i+1
    a.append(x)

#print(a)
i=0
while i!=q:
  try:
    l,r=map(int,input().split())
    i=i+1
    s=a[r-1]-a[l-1]
    print(s)
  except:
      break
S = input()

ans = 0
for i in range(len(S)-3):
    for j in range(i+3, len(S)):
        if int(S[i:j+1]) % 2019 == 0:
            ans += 1
print(ans)

### FIXED CODE ###

S, W = map(int, input().split())

if W >= S:
    print("unsafe")
else:
    print("safe")
N, A, B, C, D, E = map(int, input().split())
min=min(A, B, C, D, E)
print(-(-N//min)

### FIXED CODE ###

N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
min=min(A, B, C, D, E)
print(-(-N//min)+4)