Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline
 
S = input()
T = input()
score_list = []
for i in range(0, len(S)-len(T)):
  s = S[i:i+len(T)]
  score = sum([1 if s[i]==T[i] else 0 for i in range(len(s))])
  score_list.append(score)
print(len(T) - max(score_list))

### FIXED CODE ###

import sys
input = sys.stdin.readline
S = input().strip()
T = input().strip()
score_list = []
for i in range(len(S) - len(T) + 1):
  s = S[i:i+len(T)]
  score = 0
  for i in range(len(s)):
    if s[i] != T[i]:
      score += 1
  score_list.append(score)
print(min(score_list))
s = input()

if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No)

### FIXED CODE ###

s = input()
 
if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No')
import sys
N, M, *PS = sys.stdin.read().strip().split()
N = int(N)
ac = [0] * N
wa = [0] * N
for p, s in zip(*[iter(PS)] * 2):
  p = int(p) -1
  if s == "AC":
    ac[p] = 1
  elif ac[p] == 0:
    wa[p] += 1
penalties = sum([w or a for a, w in zip(ac, wa)])
print("{} {}".format(sum(ac),penalties)

### FIXED CODE ###

N, M = map(int, input().split())
PS = [list(map(str, input().split())) for _ in range(M)]
ac = [False] * N # index means p
wa = [0] * N # index means p
wa_cnt = 0
for ps in PS:
  p = int(ps[0]) - 1 # index starts from 0
  s = ps[1]
  if not ac[p] and s == "AC":
    wa_cnt += wa[p]
    ac[p] = True
  elif s == "WA":
    wa[p] += 1
print(ac.count(True), wa_cnt)
str = input()

str_list = list(str)

if str_list[2] == str_list[3] && str_list[4] == str_list[5]:
print('Yes')
else:
print('No')



### FIXED CODE ###

str = input()
 
if str[2] == str[3] and str[4] == str[5]:
     print('Yes')
else:
     print('No')
import collections as c
s=input()
a=c.Counter(s)
if a.value()==[2,2]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import collections as c
s=input()
a=c.Counter(s)
if str(a.values())=='dict_values([2, 2])':
  print('Yes')
else:
  print('No')
N = int(input())
c = str(input())

a = 0
b = 0

for i in range(N):
    if s[i] == 'R':
        a = a + 1
ans = max(a,b)
for i in range(N):
    if s[i] == 'R':
        a = a - 1
    else:
        b = b + 1
    now = max(a,b)
    ans = min(ans, now)
print(ans)


### FIXED CODE ###

N = int(input())
s = str(input())

a = 0
b = 0

for i in range(N):
    if s[i] == 'R':
        a = a + 1
ans = max(a,b)
for i in range(N):
    if s[i] == 'R':
        a = a - 1
    else:
        b = b + 1
    now = max(a,b)
    ans = min(ans, now)
print(ans)
n = int(input())
a = [int(n) for n in input().split()]
ans = 1

for i in range(n):
    ans *= a[i]
        if ans => 10**18:
            exit:
                
if ans ** 10**18:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

n = int(input())
s = list(map(int,input().split()))
ans = 1

if 0 in s:
    print(0)
else:    
    for i in range(n):
        ans *= s[i]
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)
N=input()
if N%2==0:
  ans=0.5
else:
  ans=(N+1)/(2*N)
print(ans)
  

### FIXED CODE ###

n=int(input())
if n%2==0:
    print(0.5)
else:
    print((n+1)/(2*n))
s = list(map(int, input().split()))
ans = 0
for i in range(3):
    if s[i] == 1:
        ans += 1

print(ans)


### FIXED CODE ###

s = list(input())
ans = 0
for i in range(3):
    if s[i] == '1':
        ans += 1

print(ans)
K,X=int(input( ))
print ('Yes' if 500 * K => X else 'No')

### FIXED CODE ###

a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')
while True:
    x=input().split()
    h=int(x[0])
    w=int(x[0])
    if a==0 and b==0:break
    for i in range (h):
        for j in range (w):
            print('#'*w)
        print()
    print()


### FIXED CODE ###

while True:
    v=input().split()
    a=int(v[0])
    b=int(v[1])
    if a==0 and b==0:
       break
    for i in range (a):
        print('#'*b)
    print()
s = input()
t = input()
print("Yes" if s in t else: "No")

### FIXED CODE ###

s = input()
t = input()
if((c.islower() for c in s) and (d.islower() for d in t) and (s == t[0:len(s)]) and len(s) + 1 == len(t)):
  print("Yes")
else:
  print("No")
a = list(map(int,input().split()))
if a[0] == a[1]:
    print('Yes')
elif:
    print('No')

### FIXED CODE ###

a = list(map(int,input().split()))
if a[0] == a[1]:
    print('Yes')
else:
    print('No')
N = int(input())
h = list(map(int, input().split()))

# #大きな値
INF = 10**10
#
# # DPtable
dp = [INF]*10000

# dp = [10**10 for _ in range(N)]


#初期条件
dp[0] = 0
dp[1] = abs(h[1]-h[0])

#ループ
for i in range(N):
    if i == 0 or i == 1:
        continue
    else:
        dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i]-h[i-2]))


print(dp[N-1])



### FIXED CODE ###

# N = int(input())
# h = list(map(int, input().split()))
# 
# #大きな値
# INF = 9999
# 
# # DPtable
# dp = [INF]*9999
# 
# #初期条件
# dp[0] = 0
# dp[1] = abs(h[1]-h[0])
# 
# #ループ
# for i in range(N):
#     if i == 0 or i == 1:
#         continue
#     else:
#         dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i]-h[i-2]))
# 
# print(dp[N-1])

N = int(input())
h = list(map(int, input().split()))
dp = [10 ** 10 for _ in range(N)]
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(2, N):
    dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))

print(dp[-1])
import math
A, B, C, D = map(int, input().split())
if A == C or B == D:
    print(0)
    exit()

x = abs(A - C)
y = abs(B - D)

print(x + y - math.gcd(x, y))


### FIXED CODE ###

import math
import fractions
A, B, C, D = map(int, input().split())
if A == C or B == D:
    print(0)
    exit()

x = abs(A - C)
y = abs(B - D)

print(x + y - fractions.gcd(x, y))
import math
a,b=map(int,input().split())
print(math.ceil(a/(s*b-1))


### FIXED CODE ###

import math
a,b=map(int,input().split())
print(math.ceil(a/(2*b+1)))
N,K = map(int,input().split())
T = list(map(int,input().split()))
Number = []
for j in range(N-K+1):
    Num=1
    for i in range(K):
        Num *=T[i+j]/10***3
    Number.append(Num)

for p in range(N-K):
    if Number[p+1] - Number[p] >0:
        print('Yes')
    else:
        print('No')
    

### FIXED CODE ###

N,K = map(int,input().split())
T = list(map(int,input().split()))
for p in range(N-K):
    if T[p] - T[p+K] <0:
        print('Yes')
    else:
        print('No')
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(x, x % y)


def prime_factorize(n):
    p = []
    while n % 2 == 0:
        if 2 not in p:
            p.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if f not in p:
                p.append(f)
                p //= f
        else:
            f += 2
    if n != 1 and n not in p:
        p.append(n)
    return p


a, b = map(int, input().split())
q = prime_factorize(gcd(a, b))
print(len(q) + 1)


### FIXED CODE ###

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


def prime_factorize(n):
    p = []
    while n % 2 == 0:
        if 2 not in p:
            p.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if f not in p:
                p.append(f)
            n //= f
        else:
            f += 2
    if n != 1 and n not in p:
        p.append(n)
    return p


a, b = map(int, input().split())
q = prime_factorize(gcd(a, b))
# print(q)
print(len(q) + 1)
sa, sb, sc = [list(input()) for i in range(3)]
now = sa.pop(0)
while 1:
    #print(now, sa, sb, sc)
    if now == "a":
        now = sa.pop(0)
    elif now == "b":
        now = sb.pop(0)
    else:
        now = sc.pop(0)
    
    if sa == [] and now == "a" :
        print("A")
        break
    elif sb == [] and now == "b":
        print("B")
        break
    elif sc == [] and now == "c":
        print("C")
        break

### FIXED CODE ###

# coding: utf-8
# Here your code !

sa, sb, sc = [list(input()) for i in range(3)]
now = sa.pop(0)
while 1:
    #print(now, sa, sb, sc)
    if now == "a":
        if sa == []:
            pass
        else:
            now = sa.pop(0)
    elif now == "b":
        now = sb.pop(0)
    else:
        now = sc.pop(0)
    
    if sa == [] and now == "a" :
        print("A")
        break
    elif sb == [] and now == "b":
        print("B")
        break
    elif sc == [] and now == "c":
        print("C")
        break
#!/usr/bin/env python3
#ABC50 C

from collections import Counter
from operator import itemgetter

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

c = Counter(a)
c = list(c.items())
cc = sorted(c,key = itemgetter(1))
ccc = sorted(c,key = itemgetter(0))
if n % 2 == 1:
    if cc[1][1] != 2:
        print(0)
        quit()
    if cc[0][0] != 0:
        print(0)
        quit()
if n % 2 == 0:
    k = 0
    for i,j in ccc:
        if j == 2 and i % 2 == 1 and i == 2*k+1:
            k += 1
            continue
        else:
            print(0)
            quit()
print(2**(n//2))


### FIXED CODE ###

#!/usr/bin/env python3
#ABC50 C

from collections import Counter
from operator import itemgetter

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

c = Counter(a)
c = list(c.items())
ccc = sorted(c,key = itemgetter(0))
if n % 2 == 1:
    k = 0
    for i,j in ccc:
        if j == 2 and i == 2*k:
            k += 1
            continue
        if j == 1 and i == 0:
            k += 1
            continue
        else:
            print(0)
            quit()
if n % 2 == 0:
    k = 0
    for i,j in ccc:
        if j == 2 and i == 2*k+1:
            k += 1
            continue
        else:
            print(0)
            quit()
print(2**(n//2) % mod)
x, n = map(int, input().split())
p = map(int, input().split())
p_list = sorted(list(p), reverse=False)
dist_list = list(map(lambda y: abs(y-x), p_list))
all_list = [[]]
ans = 0
for i in range(n):
  all_list.append([p_list[i], dist_list[i]])
del all_list[0] # appendは空に追加してしまうので最初の空を削除
sort_list = sorted(all_list, key=lambda z:(z[1],z[0]))
ans = int(sort_list[0][0])
print(ans)

### FIXED CODE ###

x,n = map(int,input().split())
if n == 0:
  ans = x
else:
  p = [int(i.strip()) for i in input().split()]
  for i in range(n+1):
    ch_1 = x-i
    ch_2 = x+i
    if p.count(ch_1) == 0:
      ans = ch_1
      break
    elif p.count(ch_2) == 0:
      ans = ch_2
      break
print(ans)
week = {1: "Thursday", 2: "Friday", 3: "Saturday", 4: "Sunday", 5: "Monday", 6: "Tuesday", 7: "Wednesday"}
month = {1: 0, 2: 31, 3: 60, 4: 91, 5: 121, 6: 152, 7: 182, 8: 213, 9: 244, 10: 274, 11: 305, 12: 335}
while True:
    m, d = map(int, input().split())
    if m == 0:
        break
    days = month[m] + d
    print(week[days % 7])

### FIXED CODE ###

while True:
    m, d = map(int, input().split())
    if m == d == 0:
        break
    dim = {1: 0, 2: 31, 3: 60, 4: 91, 5: 121, 6: 152, 7: 182, 8: 213, 9: 244, 10: 274, 11: 305, 12: 335}
    ds = dim[m] + d -1
    print({0:'Thursday', 1:'Friday', 2:'Saturday', 3:'Sunday', 4:'Monday', 5:'Tuesday', 6:'Wednesday'}[ds % 7])
n = int(input())
D = list(map(int, input().split()))
m = int(input())
T = list(map(int, input().split()))
D.sort()
T.sort()
if n=<m:
    if D==T:
        print('YES')
        exit()
    else:
        print('NO')
        exit()

r = 'YES'
for i in range(m):
    if T[i] in D:
        idx = D.index(T[i])
        D = D[idx+1:]
    else:
        r = 'NO'
        break
print(r)

### FIXED CODE ###

n = int(input())
dD = input().split()
m = int(input())
dT = input().split()
d = dict()

for di in dD:
    if di in d:
        d[di] += 1
    else:
        d[di] = 1

ans = 'YES'
for ti in dT:
    if ti not in d or d[ti]==0:
        ans = 'NO'
        break
    else:
        d[ti] -= 1
print(ans)
s= input()
for i in range(len(s)):
  puts("x")

### FIXED CODE ###

s= input()
x = "x" * len(s)
print(x)
N, K, L = map(int, input().split())
par = list(range(N+1))
rank = [0] * (N+1)
cnt = [1] * (N+1)
def root(x):
  if par[x] == x:
    return x
  else:
    par[x] = root(par[x])
    return par[x]

def same(x, y):
  return root(x) == root(y)

def unite(x, y):
  xr = root(x)
  yr = root(y)
  if xr == yr:
    return
  if rank[xr] < rank[yr]:
    par[xr] = yr
  else:
    par[yr] = xr
    if rank[xr] == rank[yr]:
      rank[xr] += 1

for _ in range(K):
  x, y = map(int, input().split())
  unite(x, y)
par_r = par[:]
par = list(range(N+1))
for _ in range(L):
  x, y = map(int, input().split())
  unite(x, y)
ans = [1] * (N)
r_dict = {}

for i in range(1, N+1):
  if (par_r[i], par[i]) in r_dict:
    r_dict[(par_r[i], par[i])] += 1
  else:
    r_dict[(par_r[i], par[i])] = 1
ans = []
for i in range(1, N+1):
  ans.append(r_dict[(par_r[i], par[i])])
print(' '.join(map(str, ans)))


### FIXED CODE ###

c = input()
if c in ['a', 'i', 'u', 'e', 'o']:
  print('vowel')
else:
  print('consonant')
N, M = map(int,input().split())
crain = (4 * N - M) / 2
R = N - int(crain)
if crain.is_integer():
  if crain >= 0　and R > 0:
    print("Yes")
  else:
    print("No")
else:
  print("No")


### FIXED CODE ###

import sys
x,y = map(int,input().split())
for i in range(x+1):
  for j in range(x-i+1):
    if i+j == x and (i*2)+(j*4) == y:
      print("Yes")
      sys.exit()
print("No")
## tasks https://atcoder.jp/contests/dp/tasks

def solution():
    # result array for calculation for optimal cost for every stone
    res = [None]*n
    res[0] = 0
    res[1] = abs(h[1]-h[0])
    for i in range(2, n):
        res[i] = min(res[i-1] + abs(h[i]-h[i-1]), res[i-2] + abs(h[i]-h[i-2]))

    return res[-1]

if __name__ == "__main__":
    n = int(raw_input())

    # global scope actually
    h = list(map(int, raw_input().split(" ")))
    #print("h = {}".format(h))

    print(solution())

### FIXED CODE ###

## tasks https://atcoder.jp/contests/dp/tasks

def solution():
    # result array for calculation for optimal cost for every stone
    res = [None]*n
    res[0] = 0
    res[1] = abs(h[1]-h[0])
    for i in range(2, n):
        res[i] = min(res[i-1] + abs(h[i]-h[i-1]), res[i-2] + abs(h[i]-h[i-2]))

    return res[-1]

if __name__ == "__main__":
    n = int(input())

    # global scope actually
    h = list(map(int, input().split(" ")))

    print(solution())
from heapq import heappush, heappop
h,w=map(int,input().split())
l=[]
v=0

for _ in range(h):
  b=[0 if i=="." else 1 for i in input()]
  v+=b.count(1)
  l.extend([b])

heap=[]
heappush(heap,(1,0,0))
while h:
  d,x,y=heappop(heap)
  if x==w-1 and y==h-1:break
  for (dx,dy) in zip([1,0],[0,1]):
    ax=x+dx
    ay=y+dy
    if 0<=ax<w and 0<=ay<h and not l[ay][ax]:
      heappush(heap,(d+1,ax,ay))

print(h*w-v-d)

### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
l=[]
v=0

for _ in range(h):
  b=[0 if i=="." else 1 for i in input()]
  v+=b.count(1)
  l.extend([b])

dq=deque([])
dq.append((0,0,1))

while dq:
  x,y,d=dq.popleft()
  if x==w-1 and y==h-1:break
  for (dx,dy) in zip([-1,1,0,0],[0,0,-1,1]):
    nx=x+dx
    ny=y+dy
    if 0<=nx<w and 0<=ny<h and not l[ny][nx]:
      l[ny][nx]=2
      dq.append((nx,ny,d+1))

if x==w-1 and y==h-1:
  print(h*w-v-d)
else:
  print(-1)
a,b = int(input().split())
 
x = a+b
 
if x == int(x):
  print(x)
 
else:
  x += 1
  print(int(x))

### FIXED CODE ###

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

x = (a+b)/2
 
if x == int(x):
  print(int(x))
 
else:
  x += 1
  print(int(x))
import math
import copy
from dask.dataframe.tests.test_rolling import idx


def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input())
a=nCast(inputArr1(n))

b=copy.deepcopy(a)


def akey(a):
    return a[0],a[1]
def bkey(a):
    return a[1],a[0]
list.sort(a,key=akey,reverse=True)
list.sort(b,key=bkey,reverse=True)


def func(a,b):
    pa,pb=0,0
    tag=True
    while len(a)!=0:
        if a[0]==b[0]:
            tmp=a[0]
        else:
            v1=a[0][0]-b[0][1]
            v2=b[0][0]-b[1][1]
            if v1>v2:
                tmp=a[0]
            else:
                tmp=b[0]
        if tag:
            pa+=tmp[0]
        else:
            pb+=tmp[1]
        tag=not tag
        a,b=b,a
        a.remove(tmp)
        b.remove(tmp)
    return pa-pb
    
print(func(a,b)) 







### FIXED CODE ###

import math
import copy

def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input())
a=nCast(inputArr1(n))

def akey(a):
    return a[0]+a[1]
list.sort(a,key=akey,reverse=True)


def func(a):
    pa,pb=0,0
    tag=True
    for idx in range(0,len(a)):
        if tag:
            pa+=a[idx][0]
        else:
            pb+=a[idx][1]
        tag=not tag
    return pa-pb
    
print(func(a))
i = input()
a,b = list(map(int, l.split()))
print(a*b)

### FIXED CODE ###

a,b=map(int,input().split())
A = a*b
print(A)
n, k = map(int, input().split())
h = list(map(int, input().split()))
from bisect import bisect_left
rint(n - bisect_left(sorted(h),k))

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
from bisect import bisect_left
print(n - bisect_left(sorted(h),k))
N = int(input())
An = map(int,input().split())
Bn = map(int,input().split())
ans=0
for b in range(len(Bn)):
    left = min(An[b],Bn[b])
    ans+=left
    An[b]-=left
    Bn[b]-=left
    right = min(An[b+1],Bn[b])
    ans+=right
    An[b+1]-=right
    Bn[b]-=right
print(ans)


### FIXED CODE ###

N = int(input())
An = list(map(int,input().split()))
Bn = list(map(int,input().split()))
ans=0
for b in range(len(Bn)):
    left = min(An[b],Bn[b])
    ans+=left
    An[b]-=left
    Bn[b]-=left
    right = min(An[b+1],Bn[b])
    ans+=right
    An[b+1]-=right
    Bn[b]-=right
print(ans)
x=int(input())

b = -1
for i in range(100000):
    tmp = i*i*i*i*i + 1
    if x == tmp:
        a = i
        break

print(a,b)

### FIXED CODE ###

x=int(input())
a = 0
b = 0

for i in range(1000):
    for j in range(1,1000):
        tmp = (i*i*i*i*i) + (j*j*j*j*j)
        if x == tmp:
            a = i
            b = -j
            break

for i in range(1000):
    for j in range(1,1000):
        tmp = (i*i*i*i*i) - (j*j*j*j*j)
        if x == tmp:
            a = i
            b = j
            break

print(a,b)
from sys import setrecursionlimit
setrecursionlimit(10**7)
lst = dict({0: 1, 1: 1, 2: 2})
def calc(n):
    if (n in lst):
        return lst[n]
    else:
        lst[n] = calc(n-1) + calc(n-2)
        return lst[n]

N, M = [int(x) for x in input().split()]
a_list = [int(input()) for _ in range(M)]
span_list = [a_list[0]-1]
for i, a in enumerate(a_list[:-1]):
    if (a_list[i+1] - a) == 1:
        print(0)
        exit()
    else:
        span_list.append(a_list[i+1] - 2 - a)
span_list.append(N - a_list[-1] -1)
max_span = max(span_list)
for i in range(max_span+1):
    calc(i)
ans = 1
for span in span_list:
    ans = (ans * lst[span]) % (10**9+7)
print(ans)


### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10**7)
lst = dict({0: 1, 1: 1, 2: 2})
def calc(n):
    if (n in lst):
        return lst[n]
    else:
        lst[n] = calc(n-1) + calc(n-2)
        return lst[n]

N, M = [int(x) for x in input().split()]
if (M != 0):
    a_list = [int(input()) for _ in range(M)]
    span_list = [a_list[0]-1]
    for i, a in enumerate(a_list[:-1]):
        if (a_list[i+1] - a) == 1:
            print(0)
            exit()
        else:
            span_list.append(a_list[i+1] - 2 - a)
    span_list.append(N - a_list[-1] -1)
else:
    span_list = [N]
max_span = max(span_list)
for i in range(max_span+1):
    calc(i)
ans = 1
for span in span_list:
    ans = (ans * lst[span]) % (10**9+7)
print(ans)
a, b, c, b = map(int, input().split())
if a * b > c * d:
    print(a * b)
elif a * b < c * d:
    pritn(c * d)
else:
    print(a * b)

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if a * b > c * d:
    print(a * b)
elif a * b < c * d:
    print(c * d)
else:
    print(a * b)
n,m=map(int,input().split())
s=[]
for i in range(m):
    s.append(int(input()))
l=[1]
if s[0]!= 1:l.append(1)
else:l.append(0)
for i in range(2,n+1):
    if i in s:num=0
    else:num = (l[i-2]+l[i-1])%1000000007
    l.append(num)
print(l[-1])

### FIXED CODE ###

n,m = map(int,input().split())
s=set([int(input()) for i in range(m)])
l=[1]+[0]*n
INF=1000000007
if n ==1:
    print(1)
    exit()
if len(s)!=0 and 1 in s:l[1]=0
else:l[1]=1
for i in range(2,n+1):
    if i in s: l[i]=0
    else:l[i] = (l[i-2]+l[i-1])%INF
print(l[-1])
from collections import Counter
N = int(input())
*A, = map(int, input().split())
A.sort()
c = Counter(A)
if A[0] == 1:
    print(0)
else:
    ans = 0
    d = [0]*(10**6+1)
    for i in range(N):
        if d[A[i]] == 0:
            if c[A[i]] == 1:
                ans += 1
            j = A[i]
            while j <= (10**6):
                d[j] += 1
                j += A[i]
print(ans)


### FIXED CODE ###

from collections import Counter
N = int(input())
*A, = map(int, input().split())
A.sort()
c = Counter(A)
ans = 0
d = [0]*(10**6+1)
for i in range(N):
    if d[A[i]] == 0:
        if c[A[i]] == 1:
            ans += 1
        j = A[i]
        while j <= (10**6):
            d[j] += 1
            j += A[i]
print(ans)
#!python3

def resolve():
    N, u, v = map(int, input().rstrip().split())
    N1 = N + 1

    d = [[] for _ in range(1, N1)]
    for i in range(1, N):
        a, b = map(int, input().rstrip().split())

        d[a].append(b)
        d[b].append(a)

    from collections import deque

    def f(x):
        q = deque()
        q.append(x)
        X = [-1] * N1

        while q:
            x = q.popleft()
            for i in d[x]:
                if X[i] == -1:
                    X[i] = X[x] + 1
                    q.append(i)
        return q

    U = f(u)
    V = f(v)

    m = 0
    for uu, vv in zip(U, V):
        if uu < vv:
            if vv > m:
                m = vv
    print(m-1)

if __name__ == "__main__":
    resolve()


### FIXED CODE ###

#!python3

def resolve():
    N, u, v = map(int, input().rstrip().split())
    N1 = N + 1

    d = [[] for _ in range(0, N1)]
    for i in range(1, N):
        a, b = map(int, input().rstrip().split())

        d[a].append(b)
        d[b].append(a)

    from collections import deque

    def f(x):
        q = deque()
        q.append(x)
        X = [-1] * N1

        X[x] = 0
        while q:
            x = q.popleft()
            for i in d[x]:
                if X[i] == -1:
                    X[i] = X[x] + 1
                    q.append(i)
        return X

    U = f(u)
    V = f(v)

    m = 0
    for uu, vv in zip(U, V):
        if uu < vv:
            if vv > m:
                m = vv
    print(m-1)

if __name__ == "__main__":
    resolve()
import heapq
L,R = map(int,input().split())
numMap=[10**19]*(R-L+1)
numheap=[]
k=0

AnsA=0
AnsB=0
for i in range(L,R+1):
    num=i%2019
    heapq.heappush(numheap,num)
    if(num==3):AnsA=1
    if(num==673):AnsB=1
    k+=1

if(AnsA!=0 & AnsB!=0):
    print("0")
else:
    print(heapq.heappop(numheap)*heapq.heappop(numheap))

### FIXED CODE ###

import math
L, R = map(int, input().split())
R=min(R,L+2019)
m=2018
for i in range(L,R+1):
  for j in range(i,R+1):
    if i==j:
      continue
    if (i*j)%2019<m:
      m=(i*j)%2019
print(m)
S1 = raw.input()
S = int(S1)
if 0 <= S and S <= 86400:
   a = S // 3600
   b = S % 3600
   c = b // 60
   d = b % 60
print a + ":" + c + ":" + d

### FIXED CODE ###

S = input()
if S >= 0 and S <= 86400:
   a = S // 3600
   b = S % 3600
   c = b // 60
   d = b % 60
   print "%d:%d:%d" % (a, c, d)