Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())

ab_list = []
cd_list = []

for i in range(N):
    ab = list(map(int, input().split()))
    ab_list.append(ab)

for i in range(M):
    cd = list(map(int, input().split()))
    cd_list.append(cd)

for a, b in ab_list:
    num = -1
    min_num = 10 ** 10 + 1
    count = 0
    for c, d in cd_list:
        count += 1
        distance = abs(a-c) + abs(b-d)
        if distance < min_num:
            min_num = distance
            num = count
    print(num)

### FIXED CODE ###

A, B = map(int, input().split())
if A+B < 24:
   print(A+B)
else:
    print(A+B-24)
from math import sqrt
x_1,y_1,x_2,y_2=map(int,raw_input().split(" "))
print sqrt((x_1-x_2)**2 + (y_1-y_2)**2)

### FIXED CODE ###

from math import sqrt
x_1,y_1,x_2,y_2=map(float,raw_input().split(" "))
print sqrt((x_1-x_2)**2 + (y_1-y_2)**2)
import sys
def main():
  S=list(sys.stdin.readline())[:-1]
  T=list(sys.stdin.readline())[:-1]
  lS=len(S)
  lT=len(T)
  dp=[[0]*lS for _ in range(lT)]
  for iT in range(lT):
    for iS in range(lS):
      if S[iS]==T[iT]:
        if iS-1>=0 and iT-1>=0:
          dp[iT][iS] = dp[iT-1][iS-1]+1
        else:
          dp[iT][iS] = 1
      else:
        if iS-1>=0 and (iT-1<0 or dp[iT][iS-1]>=dp[iT-1][iS]):
          dp[iT][iS] = dp[iT][iS-1]
        elif iT-1>=0 and (iS-1<0 or dp[iT-1][iS]>=dp[iT][iS-1]):
          dp[iT][iS] = dp[iT-1][iS]

  iS = lS-1
  iT = lT-1
  ans = ""
  while(iS>0 and iT>0):
    if dp[iT][iS]==dp[iT-1][iS-1]:
      iS -= 1
      iT -= 1
    elif dp[iT][iS]==dp[iT][iS-1]:
      iS -= 1
    else:
      ans = S[iS]+ans
      iS -= 1
      iT -= 1
  if dp[iT][iS]=1:
    if iS == 0:
      ans = S[0]+ans
    else:
      ans = T[0]+ans
  print(ans)

if __name__ == '__main__':
  main()


### FIXED CODE ###

import sys
def main():
  S=list(sys.stdin.readline())[:-1]
  T=list(sys.stdin.readline())[:-1]
  lS=len(S)
  lT=len(T)
  dp=[[0]*(lS+1) for _ in range(lT+1)]
  for iT in range(lT):
    for iS in range(lS):
      if S[iS]==T[iT]:
        dp[iT+1][iS+1] = max(dp[iT+1][iS],dp[iT][iS+1],dp[iT][iS]+1)
      else:
        dp[iT+1][iS+1] = max(dp[iT+1][iS],dp[iT][iS+1])

  iS = lS
  iT = lT
  ans = ""
  while(iS>0 and iT>0):
    if dp[iT][iS]==dp[iT-1][iS-1]:
      iS -= 1
      iT -= 1
    elif dp[iT][iS]==dp[iT][iS-1]:
      iS -= 1
    elif dp[iT][iS]==dp[iT-1][iS]:
      iT -= 1
    else:
      ans = S[iS-1]+ans
      iS -= 1
      iT -= 1
  print(ans)

if __name__ == '__main__':
  main()
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(0,M):
    A[A.index(max)]=int(A[A.index(max)])

print(sum(A))

### FIXED CODE ###

import heapq
N, M = map(int, input().split())
A = list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(A)
for i in range(0,M):
    a=heapq.heappop(A)
    heapq.heappush(A,(-1)*(-a//2))
print(-sum(A))

#　優先度付きキューが難しい
n = int(input())
p = 1
for i in range(1,n+1):
  p = p*i
ap = p/1000000007
print(ap)


### FIXED CODE ###

n = int(input())
import math
p = math.factorial(n)
ap = p%1000000007
print(ap)
S = list(input())
s = len(S)
K = int(input())
A = []
j = 1

for i in range(0,s-1,1):
  if S[i] == S[i+1]:
    j += 1
  else:
    A.append(j)
    j = 1
A.append(j)

a = len(A)

b = 0
for i in range(a):
  b += i//2
  
x = b*K

if S[s-1] == S[0] and A[a-1] % 2 == 1 and A[1] % 2 == 1:
  x += K-1
  
print(x)

### FIXED CODE ###

N,A,B = map(int,input().split())
if (B-A) % 2 == 0:
  print((B-A)//2)
elif A-1 <= N-B:
  print((A+B-1)//2)
else:
  print(N+1-(B+A+1)//2)
#include<iostream>
#include<string>
using namespace std;
string s;
int n;
n=s.length()
cin>>s
int sum=0;
for(int i=0;i<n,i++){
for(int j=i+1;j<n,j++){
string num=str.substr(i,j-i+1);
  int x=stoi(num);
  if(x%2019==0){
  sum+=1;
  }
  
}
}
cout<<sum;

### FIXED CODE ###

import sys
import collections as coun
sys.setrecursionlimit(10000000)
s=input()
n=len(s)
def mod10(x):
    return (10**(x%224))%2019
dp=[-1]*n
tmp=0
for i in reversed(range(n)):
    if i==n-1:
        dp[i]=int(s[i])
    else:
        dp[i]=(dp[i+1]+int(s[i])*pow(10,n-1-i,2019))%2019

#print(dp)
p=-1
for i in range(len(dp)-1):
    if dp[i]==dp[i+1]:
        dp[i]=p
        p=p-1

#print(dp)

c=coun.Counter(dp)
sum=0
for v in c.values():
    sum+=v*(v-1)//2
#print(sum)
for i in dp:
    if i==0:
        sum+=1
#print(sum)
if dp[-1]==0:
    sum=sum-1
print(sum)
n = int(input())
s = input()
alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]*2

ans = [0]*n
for i in range(s):
    S = s[i]
    key = alphabet.index(S)
    ans[i] = alphabet[key+n]
print("".join(ans))

### FIXED CODE ###

n = int(input())
s = input()
alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

ans = [0]*len(s)
for i in range(len(s)):
    S = s[i]
    key = (alphabet.index(S))
    ans[i] = alphabet[(key+n)%26]
print("".join(ans))
n = int(input())
a = list(map(int,input().split()))
g1 = a[1::2]
g2 = a[::2]
ans1,ans2 = 0,0
l1,l2 = [],[]
for i in range(len(g1)):
    if g1[i]>0:
        ans1 += g1[i]
        l1.append(i*2+2)
for i in range(len(g2)):
    if g2[i]>0:
        ans2 += g2[i]
        l2.append(i*2+1)
length = n
if ans1>=ans2:
    print(ans1)
    list = []
    for i in range(n,l1[-1],-1):
        list.append(i)
    length -= n-l1[-1]
    for i in range(l1[-1],l1[0],-2):
        if not i in l1:
            list.append(i)
            length -= 2
    for i in range(l1[0]-1):
        list.append(1)
    length -= l1[0]
    for _ in range(length,0,-2):
        list.append(2)
    print(len(list))
    for i in list:
        print(i)
else:
    print(ans2)
    list = []
    for i in range(n,l2[-1],-1):
        list.append(i)
    length -= n-l2[-1]
    for i in range(l2[-1],l2[0],-2):
        if not i in l2:
            list.append(i)
            length -= 2
    for i in range(l2[0]-1):
        list.append(1)
    length -= l2[0]
    for _ in range(length,0,-2):
        list.append(2)
    print(len(list))
    for i in list:
        print(i)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
f = 1
for i in range(n):
    if a[i]>0:
        f = 0
if f:
    ind = a.index(max(a))
    print(max(a))
    list = []
    for i in range(n,ind+1,-1):
        list.append(i)
    for _ in range(ind):
        list.append(1)
    print(len(list))
    for i in list:
        print(i)
    exit()
g1 = a[1::2]
g2 = a[::2]
ans1,ans2 = 0,0
l1,l2 = [],[]
for i in range(len(g1)):
    if g1[i]>0:
        ans1 += g1[i]
        l1.append(i*2+2)
for i in range(len(g2)):
    if g2[i]>0:
        ans2 += g2[i]
        l2.append(i*2+1)
length = n
if ans1>=ans2:
    print(ans1)
    list = []
    for i in range(n,l1[-1],-1):
        list.append(i)
    length -= n-l1[-1]
    for i in range(l1[-1],l1[0],-2):
        if not i in l1:
            list.append(i)
            length -= 2
    for i in range(l1[0]-1):
        list.append(1)
    length -= l1[0]
    for _ in range(length,0,-2):
        list.append(2)
    print(len(list))
    for i in list:
        print(i)
else:
    print(ans2)
    list = []
    for i in range(n,l2[-1],-1):
        list.append(i)
    length -= n-l2[-1]
    for i in range(l2[-1],l2[0],-2):
        if not i in l2:
            list.append(i)
            length -= 2
    for i in range(l2[0]-1):
        list.append(1)
    length -= l2[0]
    for _ in range(length,0,-2):
        list.append(2)
    print(len(list))
    for i in list:
        print(i)
from decimal import *
import re
def solve2(m, n):
    maxlen = 80
    PREC=200
    getcontext().prec = PREC
    x = Decimal(m) / Decimal(n)
    s = x.to_eng_string()
    if len(s) < PREC:
        return(s[2:],'')
    rep = 1
    while True:
        r = r'(.{%d})\1{%d,}' % (rep, int((PREC-40)/rep))  #ex. '(.{6})\\1{12,}'
        a=re.search(r, s)
        if a:
            break
        rep += 1
        if rep > maxlen:
            raise ValueError('This cannot happen.rep=%d' % rep)

    u = s[2:a.start()+len(a.group(1))]
    v = (' '*PREC + '^'*len(a.group(1)))[-len(u):]
    return(u,v)

while True:
    try:
        m,n = map(int, input().strip().split())
        s,t = solve2(m, n)
        print(s)
        if t!='':
            print(t)
    except EOFError:
        break

### FIXED CODE ###

from decimal import *
import re
def solve2(m, n):
    maxlen = 80
    PREC=180
    getcontext().prec = PREC
    x = Decimal(m) / Decimal(n)
    s = x.to_eng_string()
    if len(s) < PREC:
        return(s[2:],'')
    rep = 1
    while True:
        r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep))  #ex. '(.{6})\\1{13,}'
        a=re.search(r, s)
        if a:
            break
        rep += 1
        if rep > maxlen:
            raise ValueError('This cannot happen.rep=%d' % rep)

    u = s[2:a.start()+len(a.group(1))]
    v = (' '*PREC + '^'*len(a.group(1)))[-len(u):]
    return(u,v)

while True:
    try:
        m,n = map(int, input().strip().split())
        s,t = solve2(m, n)
        print(s)
        if t!='':
            print(t)
    except EOFError:
        break
N = map(int, input())
cards = map(int, input().split())

num = cards.sort(reverse=True)

sum_A = 0
sum_B = 0

for i in range(N):
  if i % 2 == 0:
    sum_A += num[i]
  else:
    sum_B += num[i]

print(sum_A - sum_B)

### FIXED CODE ###

N = int(input())
cards = list(map(int,input().split()))
 
cards.sort(reverse=True)
 
sum_A = 0
sum_B = 0
 
for i in range(N):
    if i % 2 == 0:
        sum_A += cards[i]
    else:
        sum_B += cards[i]
print(sum_A - sum_B)
N,X =  map(int, input().split())

a = list(map(int, input().split()))
a.sort(reverse=True)

dp = [[-1 for i in range(N+10)] for j in range(N+10)]


def deposit(n, trash):
    if n + 1 == N:
        return X + a[n] * ((trash+1) ** 2)

    if dp[n][trash] != -1:
        return dp[n][trash]

    #もってるゴミをかえすか、そのまま次のゴミをひろうか？
    dp[n][trash] = min(X+a[n]*((trash+1)**2)+X+a[n+1]+deposit(n+1,1),(a[n]-a[n+1])*((trash+1)**2)+X+deposit(n+1,trash+1))
    return dp[n][trash]


print(deposit(0,1)+X+a[0])

### FIXED CODE ###


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

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

a = a[::-1]

dp = [0 for i in range(N+1)]
for i in range(1,N+1):
    dp[i] = a[i-1] + dp[i-1]

ans = 10**100

for k in range(1,N+1):
    cur = (N+k) * X


    count = 1
    i = k
    while 1:
        first = i - k
        last = min(N,i)
        flag = False
        if i > N:
            flag = True

        if count == 1:
            cur += dp[last] * 5
        else:
            cur += (dp[last] - dp[first]) * (2*count + 1)

        count += 1
        i += k
        
        if flag:
            break


        
    ### print(dp, cur)
    ans = min(ans, cur)

print(ans)
n = int(input())
if sum(n)%9 ==0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = int(input())
if n%9 ==0:
    print("Yes")
else:
    print("No")
if len(S) <= K:
    print(S)
else:
    print(S[0: K] + '...')

### FIXED CODE ###

K = int(input())
S = input()


if len(S) <= K:
    print(S)
else:
    print(S[0: K] + '...')
a,b = map(int , input().split())
if a < b :
print("a < b")
elif a > b:
print("a > b")
else:
print("a == b")



### FIXED CODE ###

a,b = map(int, input().split())
if a<b:
	print("a < b")
elif a==b:
	print("a == b")
else:
	print("a > b")
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def rec(a: int, b: int) -> int:
    if a == b:
        return a
    
    else:
        mx = max(a,b)
        mn = min(a,b)
        return 2*mn + rec(mn, mx-mn)
    
n,x = li()
print(n + rec(x, n-x))
    

### FIXED CODE ###

import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def light_length(a:int, b:int) -> int:
    if a > b:
        a,b = b,a
    
    if b%a == 0:
        return 2 * a * (b//a) - a

    return 2 * (b//a) * a + light_length(a, b%a)

n,x = li()

print(n + light_length(x,n-x))
N, K = map(int, input().split())
A = list(map(int, ("0 "+input()).split()))


c = [0]*(N+1)
i = 1
cnt = 0
f = True

while cnt < K:
    if f and c[A[i]]:
        print(cnt, i, c)
        loop = cnt-c[A[i]]
        cnt += (K-cnt-1)//loop*loop
        if cnt == K:
            break
        f = False

    cnt += 1
    i = A[i]
    c[i] = cnt

print(i)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, ("0 "+input()).split()))


c = [0]*(N+1)
i = 1
cnt = 0
f = True

while cnt < K:
    if f and (c[A[i]] or A[i]==1):
        loop = cnt-c[A[i]]+1
        cnt += (K-cnt-1)//loop*loop
        f = False

    cnt += 1
    i = A[i]
    c[i] = cnt

print(i)
from numpy import*
from itertools import*
n=int(input())
s=input()
t=s.count("#")
r=s.count(".")

l=[t,r]
x=[len(list(v))for k,v in groupby(s)if k=="#"]
y=[len(list(v))for k,v in groupby(s)if k=="."]
if len(x)>len(y):
    y=[0]+y
elif len(x)<len(y):
    x=[0]+x
else:
    if s[0]=="#":
        y=[0]+y
        x=x+[0]
    else:
        y=y+[0]
        x=[0]+x
x=array(list(accumulate(x)))
y=array(list(accumulate(y[::-1]))[::-1]+[0]*(s[-1]=="#"))
print(min(x+y))

### FIXED CODE ###

n=int(input())
s=input()
r=s.count(".")
ans=[r]
for i in s:
    if i=="#":
        r+=1
    else:
        r-=1
    ans.append(r)
print(min(ans))
from collections import*
from heapq import*
def dijkstra(s):
  d=[inf]*n
  used=[True]*n
  d[s]=0
  used[s]=False
  edgelist=[]
  for e in edge[s]:
    heappush(edgelist,e)
  while len(edgelist):
    minedge=heappop(edgelist)
    if not used[minedge[1]]:
      continue
    v=minedge[1]
    d[v]=minedge[0]
    used[v]=False
    for e in edge[v]:
      if used[e[1]]:
        heappush(edgelist,(e[0]+d[v],e[1]))
  return d
inf=10**18
n,m,*t=map(int,open(0).read().split())
e=defaultdict(list)
s=[]
l=[]
f=False
for a,b,c in zip(t[::3],t[1::3],t[2::3]):
  if b<a:a,b=b,a
  if a<2 or b<2:f=True
  x,y=a+-~n*c,b+-~n*c
  if b==n:l.append(y)
  e[a].append((1,x))
  e[b].append((1,y))
  e[x].extend([(0,a),(0,y)])
  e[y].extend([(0,b),(0,x)])
  s.extend([a,b,x,y])
if not f:
  print(-1)
  exit()
d={i:v for v,i in enumerate(sorted(set(s)))}
n=len(d)
edge=tuple([]for _ in range(n))
for i in e:
  edge[d[i]].extend([(c,d[j])for c,j in e[i]])
a=dijkstra(0)
a=min(a[d[i]]for i in l)
print([a,-1][a==inf])

### FIXED CODE ###

def main():
  from heapq import heappush,heappop,heapify
  inf=2**31-1
  n,m,*t=map(int,open(0).read().split())
  z=[]
  for a,b,c in zip(t[::3],t[1::3],t[2::3]):
    z.extend([a,b,a+n*c,b+n*c])
  z={i:v for v,i in enumerate(sorted(set(z)))}
  try:
    z[1]
  except:
    print(-1)
    exit()
  edge=[[]for _ in range(len(z))]
  d={}
  l=[]
  for a,b,c in zip(t[::3],t[1::3],t[2::3]):
    if b<a:a,b=b,a
    i,j,x,y=z[a],z[b],z[a+n*c],z[b+n*c]
    if b==n:
      l.append(y)
    edge[i].append((1,x))
    edge[j].append((1,y))
    edge[x].extend([(0,i),(0,y)])
    edge[y].extend([(0,j),(0,x)])
  used=[False]+[True]*~-len(z)
  d=[0]+[inf]*~-len(z)
  edgelist=edge[0]
  heapify(edgelist)
  while edgelist:
    m=heappop(edgelist)
    if not used[m[1]]:
      continue
    d[m[1]]=m[0]
    used[m[1]]=False
    for e in edge[m[1]]:
      if used[e[1]]:
        heappush(edgelist,(e[0]+m[0],e[1]))
  a=min([d[i]for i in l]or[inf])
  print([a,-1][a==inf])
if __name__=='__main__':
  main()
import bisect
inf = 10**18
a, b, q = map(int, input().split())
s = [-inf] + [int(input()) for _ in range(a)] + [inf]
t = [-inf] + [int(input()) for _ in range(a)] + [inf]

for _ in range(q):
    x = int(input())
    i = bisect.bisect_right(s, x)
    j = bisect.bisect_right(t, x)
    ans = inf
    for s_x in [s[i-1], s[i]]:
        for t_x in [t[j-1], t[j]]:
            ans0 = abs(s_x - x) + abs(t_x - s_x)
            ans1 = abs(t_x - x) + abs(s_x - t_x)
            ans = min(ans, ans0, ans1)
    print(ans)

### FIXED CODE ###

a, b, q = map(int, input().split())
s = [int(input()) for _ in range(a)]
t = [int(input()) for _ in range(b)]
x = [(int(input()), i) for i in range(q)]
x = sorted(x)

def check(x, s0, s1, t0, t1):
    ans = float('inf')
    for x1, x2 in [(s0, t0), (s0, t1), (s1, t0), (s1, t1),
                   (t0, s0), (t0, s1), (t1, s0), (t1, s1)]:
        ans = min(ans, abs(x-x1)+abs(x1-x2))
    return ans

s0, t0 = -float('inf'), -float('inf')
s1, t1 = s[0], t[0]
i_s, i_t = 0, 0
answers = []
for x_i, i in x:
    while s1 < x_i and i_s < a-1:
        s0 = s1
        i_s += 1
        s1 = s[i_s]
    while t1 < x_i and i_t < b-1:
        t0 = t1
        i_t += 1
        t1 = t[i_t]
    ans = check(x_i, s0, s1, t0, t1)
    answers.append((i, ans))

for _, ans in sorted(answers):
    print(ans)
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
b=[0]*n
for i in range(q):
  b[i]=a.count(i+1)
if k-q>0:
  for _ in range(n):
    print("Yes")
else:
  for i in range(n):
    if k-q+b[i]>0:
      print("Yes")
    else:
      print("No")

### FIXED CODE ###

n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
b=[0]*n
for i in range(q):
  b[a[i]-1]+=1
if k-q>0:
  for _ in range(n):
    print("Yes")
else:
  for i in range(n):
    if k-q+b[i]>0:
      print("Yes")
    else:
      print("No")
N, M = map(int, input().split())
LRD = [list(map(int, input().split())) for _ in range(M)]

graph = [{} for _ in range(N)]
for l, r, d in LRD:
	l, r = l - 1, r - 1
	graph[l][r] = d
	graph[r][l] = -d

def dfs(v, p, d, depths):
	if depths[v] != -1:
		return True
	depths[v] = d

	for n in graph[v]:
		if n == p:
			continue
		n_depth = d + graph[v][n]
		if depths[n] != -1 and depths[n] != n_depth:
			return False
		result = dfs(n, v, n_depth, depths)
		if not result:
			return False
	return True

for n in range(N):
	if not dfs(n, -1, 0, [-1] * N):
		print("No")
		break
else:
	print("Yes")


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N, M = map(int, input().split())
LRD = [list(map(int, input().split())) for _ in range(M)]

graph = [{} for _ in range(N)]
for l, r, d in LRD:
	l, r = l - 1, r - 1
	graph[l][r] = d
	graph[r][l] = -d

visited = [False] * N
depths = [-1] * N
def dfs(v, p, d):
	if visited[v]:
		return True
	visited[v] = True
	depths[v] = d

	for n in graph[v]:
		if n == p:
			continue
		n_depth = d + graph[v][n]
		if depths[n] != -1 and depths[n] != n_depth:
			return False
		result = dfs(n, v, n_depth)
		if not result:
			return False
	return True

for n in range(N):
	if not dfs(n, -1, 0):
		print("No")
		break
else:
	print("Yes")
import numpy as np
M,D = map(int,input().split())
a = 0
for i in np.arange(1,D+1):
	d10 = int(i/10)
	d01 = i-d10*10
    if 0 < d10*d01 and d10*d01 <= M:
    	a += 1
print(a)

### FIXED CODE ###

import numpy as np
M,D = map(int,input().split())
a = 0
for i in np.arange(22,D+1):
  d10 = int(i/10)
  d01 = i-d10*10
  if d01 <= 1:
    continue
  if 0 < d10*d01 and d10*d01 <= M:
    a += 1
print(a)
N, A, B,C,D = map(int,input().split())
S = list(input())

a = A-1
b = B-1
c = C-1
d = D-1

ans = 1

for i_a in range(a,C):
  #2連続の##がa~Cにないことを確認
  if S[i_a] == "#":
    if S[i_a+1] == "#":
      ans =0

for i_b in range(b,D):
  #2連続の##がb~Dにないことを確認
  if S[i_b] == "#":
    if S[i_b+1] == "#":
      ans =0

if D < C:
  ans = 0
  for i in range(b-1,D+1):
    #3連続があるなら1
    if S[i] == ".":
      if S[i+1] == ".":
        if S[i+2] == ".":
          ans = 1

if ans ==1:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

N, A, B,C,D = map(int,input().split())
S = list(input())

a = A-1
b = B-1
c = C-1
d = D-1

ans = 1

for i_a in range(a,C):
  #2連続の##がa~Cにないことを確認
  if S[i_a] == "#":
    if S[i_a+1] == "#":
      ans =0

for i_b in range(b,D):
  #2連続の##がb~Dにないことを確認
  if S[i_b] == "#":
    if S[i_b+1] == "#":
      ans =0

if D < C:
  ans = 0
  for i in range(b,D):
    #3連続があるなら1
    if S[i-1] == ".":
      if S[i] == ".":
        if S[i+1] == ".":
          ans = 1

if ans ==1:
  print("Yes")
else:
  print("No")
n,m=input().split("  ")
m=int(m)
n=int(n)
multi=(m*n)-(m+n)+1
print(multi)


### FIXED CODE ###

n,m=input().split(" ")
m=int(m)
n=int(n)
multi=(m*n)-(m+n)+1
print(multi)
print()
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n,m = map(int, input().split())
    a = list(map(int, input().split()))
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a % b)
    
    def gcd_group(arr):
        g = gcd(arr[0], arr[1])
        for i in range(2, len(arr)):
            g = gcd(g, arr[i])
        return g
    
    def lcm(a, b):
        g = gcd(a, b)
        return (a*b)//g
    
    def lcm_group(arr):
        l = lcm(arr[0], arr[1])
        for i in range(2, len(arr)):
            l = lcm(l, arr[i])
        return l
    b = lcm_group(a)
    for i in a:
        if (b//i) % 2 == 0:
            print(0)
            exit()

    print((m-b//2)//b + 1)

if __name__ == '__main__':
    main()

### FIXED CODE ###

'''
https://atcoder.jp/contests/abc150/tasks/abc150_d
'''
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n,m = map(int, input().split())
    a = list(map(int, input().split()))
    a = list(set(a))

    if len(a) == 1:
        if m >= a[0]//2:
            print((m-a[0]//2) // a[0] + 1)
        else:
            print(0)
        exit()

    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a % b)
    
    def gcd_group(arr):
        g = gcd(arr[0], arr[1])
        for i in range(2, len(arr)):
            g = gcd(g, arr[i])
        return g
    
    def lcm(a, b):
        g = gcd(a, b)
        return (a*b)//g
    
    def lcm_group(arr):
        l = lcm(arr[0], arr[1])
        for i in range(2, len(arr)):
            l = lcm(l, arr[i])
        return l
    g = gcd_group(a)
    for i in a:
        if (i//g)%2 == 0:
            print(0)
            exit()
    lcm = lcm_group(a)
    semi_lcm = lcm // 2
    if m >= semi_lcm:
        print((m-semi_lcm)//lcm + 1)
    else:
        print(0)


if __name__ == '__main__':
    main()
n= int(input())
v_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]

val = 0
for _ in zip(v_list, c_list):
  if(v_list>=c_list):
    val = val + (v_list-c_list)
 
print(val)

### FIXED CODE ###

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

val = 0
for v, c in zip(v_list, c_list):
  if(v>=c):
    val = val + (v-c)
   
print(val)
n,k,q=map(int,input().split())
diff=q-k
count=[0]*n
arr=list(map(int,input().split()))
ans=['No']*n
for i in range(n):
  count[arr[i]-1]+=1
for i in range(n):
  if count[i]>=diff:
    ans[i]='Yes'
  print(ans[i])

### FIXED CODE ###

n,k,q=map(int,input().split())
diff=q-k
count=[0]*n
arr=[int(input()) for _ in range(q)]
ans=['No']*n
for i in range(q):
  count[arr[i]-1]+=1
for i in range(n):
  if count[i]>diff:
    ans[i]='Yes'
  print(ans[i])
a = int(input())
print(((a)*(a-1))//2)

### FIXED CODE ###

a = input()
b = input()
num = 0
for i in range(3):
    if a[i] == b[i]:
        num += 1
print(num)