Harryxun/stf_run huggingface dataset:
x,n = map(int,input().split())
p = list(map(int,input().split()))
p1 = [i for i in range(0,101)]
for i in p:
    if i in p1:
        p1.remove(i)
ans = 1000
al = []
for i in p1:
    if ans >= abs(i-x):
        ans = min(abs(i-x),ans)
        al.append(i)

if len(al) == 0:
    if x < 50:
        print(0)
    else:
        print(101)
elif abs(al[-1]-x) == abs(al[-2]-x):
    print(al[-2])
else:
    print(al[-1])

### FIXED CODE ###

x,n = map(int,input().split())
p = list(map(int,input().split()))
p1 = [i for i in range(0,102)]
for i in p:
    if i in p1:
        p1.remove(i)
ans = 1000
al = []
for i in p1:
    if ans >= abs(i-x):
        ans = min(abs(i-x),ans)
        al.append(i)

if len(al) == 0:
    if x < 50:
        print(0)
    else:
        print(101)
elif len(al) > 1:
    if abs(al[-1]-x) == abs(al[-2]-x):
        print(al[-2])
    else:
        print(al[-1])
else:
    print(al[-1])
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
p = sum(P)
q = sum(Q)
m = 0
l = 0
for i in range(N):
    if P[i] - Q[i] > 0:
        if (P[i] - Q[i]) % 2 == 1:
            #p += (P[i] - Q[i]) * 2
            m += (P[i] - Q[i] + 1) // 2
            l += 1
        else:
            #p += (P[i] - Q[i])
            m += (P[i] - Q[i]) // 2
    elif P[i] - Q[i] < 0:
        #q += (Q[i] - P[i])
        l += (Q[i] - P[i])

a = p + m * 2
b = q + m

if a > b:
    print("No")
elif a == b:
    print("Yes")
else:
    if l % m == 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
p = sum(P)
q = sum(Q)
if P == Q:
    print("Yes")
else:
    m = 0
    l = 0
    for i in range(N):
        if Q[i] - P[i] > 0:
            if (Q[i] - P[i]) % 2 == 1:
                #p += (P[i] - Q[i]) * 2
                m += (Q[i] - P[i] + 1) // 2
                l += 1
            else:
                m += (Q[i] - P[i]) // 2
        elif Q[i] - P[i] < 0:
            #q += (Q[i] - P[i])
            l += (P[i] - Q[i])
    if m >= l:
        print("Yes")
    else:
        print("No")
import math
            n,a,b=map(int,input().split(" "))
            kouho=[]
            for i in range(0,n+1)
            	i=str(i)
            	keta=list(map(int,i))
            	wa=sum(keta)
                if a<=wa<=b:
                  kouho.append(int(i))
            print(sum(kouho))
             

### FIXED CODE ###

n,a,b=map(int,input().split(" "))
kouho=[]
for i in range(1,n+1):
  i=str(i)
  keta=list(map(int,i))
  wa=sum(keta)
  if a<=wa<=b:
    kouho.append(int(i))
print(sum(kouho))
N, M = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X[E-1] = 1
    if E == N:
        Y[S-1] = 1
for i in range(N):
    if X[i] = Y[i]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

N, M = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X[E-1] = 1
    if E == N:
        Y[S-1] = 1
for i in range(N):
    if X[i] == 1 and Y[i] == 1:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  string p;
  cin >> p;
  flag = !((p[0] == p[1])||(p[1]==p[2])||p[2]==p[3]);
  if(flag){
  cout << "No" << endl;
  }
  else{
  cout << "Yes" <<endl;
  } 
}



### FIXED CODE ###

s = input()

flag = True
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    print("Bad")
    flag = False
    break
if flag:
  print("Good")
A,B,K = map(int,input.split())
ans =[]
for i in range(1, min(A,B)+1):
  if A%i == 0 and B%i == 0:
    ans.append(i)
  if len(ans) == K:
    print(ans[len(ans)])
    exit(1)
    
      


### FIXED CODE ###

A,B,K = map(int,input().split())
ans =[]
for i in range(1, min(A,B)+1):
    if A%i == 0 and B%i == 0:
        ans.append(i)
    

print(ans[-K])
import math
a = list(map(int, input().split()))
print(str(int(a[0]*a[1] / math.gcd(a[0], a[1]))))


### FIXED CODE ###

import fractions
a = list(map(int, input().split()))
print(a[0]*a[1] // fractions.gcd(a[0], a[1]))
SA = list(input())
SB = list(input())
SC = list(input())

turn = SA.pop(0)
while True:
    if turn == "a":
        turn = SA.pop(0)
    elif turn == "b":
        turn = SB.pop(0)
    elif turn == "c":
        turn = SC.pop(0)

    if turn == "a":
        if not SA:
            print("A")
            break
    elif turn == "b":
        if not SB:
            print("B")
            break
    elif turn == "c":
        if not SC:
            print("C")
            break


### FIXED CODE ###

SA = list(input())
SB = list(input())
SC = list(input())

turn = SA.pop(0)
while True:
    if turn == "a":
        try:
            turn = SA.pop(0)
        except:
            print("A")
            break
    elif turn == "b":
        try:
           turn = SB.pop(0)
        except:
            print("B")
            break
    elif turn == "c":
        try:
            turn = SC.pop(0)
        except:
            print("C")
            break
from sys import stdin
from sys import setrecursionlimit
import numpy as np
setrecursionlimit(10 ** 7)

n,k = map(int,stdin.readline().rstrip().split())
a = list(map(int,stdin.readline().rstrip().split()))
a = [0]+a
bunki = 0
now = a[1]
lip = [1]
while True:
    bunki += 1
    if now in lip:
        break
    lip.append(now)
    now = a[now]

tenki = lip.index(now)

lis = lip[tenki:]

roop = bunki-tenki

if k < tenki: 
    print(lip[k])
    exit()
k -= tenki

print(lis[k%roop])

### FIXED CODE ###

from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

n,k = map(int,stdin.readline().rstrip().split())
a = list(map(int,stdin.readline().rstrip().split()))
a = [0]+a
bunki = 0
now = a[1]
lip = [1]
se = set()
while True:
    bunki += 1
    if now in se:
        break
    se.add(now)
    lip.append(now)
    now = a[now]

tenki = lip.index(now)
lis = lip[tenki:]
roop = bunki-tenki

if k < tenki: 
    print(lip[k])
    exit()
k -= tenki

print(lis[k%roop])
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
def main():
  for i in range(A):
    if A[i+1]==A[i]+1:
      B[A[i+1]]=B[A[i+1]]+C[i]
    print(sum(B[A[i]])
main()

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
s=0
temp=""
for i in A:
  s+=B[i-1]
  if temp==i-1:
    s+=C[temp-1]
  temp=i
print(s)
num1 = A
num2 = B
print(num1 * num2)

### FIXED CODE ###

x,y = map(int,input().split())
print(x*y)
A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
List=[list(map(int,input().split())) for i in range(M)]
minn=min(a)+min(b)

table=[[a[i]+b[j] for i in range(A)]for j in range(B)]
for i in range(M):
    minn=min(minn,table[List[i][0]-1][List[i][1]-1]-List[i][2])

print(minn)

### FIXED CODE ###

A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
List=[list(map(int,input().split())) for i in range(M)]
minn=min(a)+min(b)

for i in range(M):
    minn=min(minn,a[List[i][0]-1]+b[List[i][1]-1]-List[i][2])

print(minn)
from collections import Counter
n = int(input())
xy = [tuple([int(_) for _ in input().split()]) for i in range(N)]
if n == 1:
    result = 1
else:
    xy.sort()
    dxy = [(xy[i][0]-xy[j][0], xy[i][1]-xy[j][1])
           for i in range(N)
           for j in range(i+1, N)]
    cdxy = Counter(dxy)
    result = N - max(cdxy.values())
print(result)

### FIXED CODE ###

from collections import Counter
n = int(input())
xy = [tuple([int(_) for _ in input().split()]) for i in range(n)]
if n == 1:
    result = 1
else:
    xy.sort()
    dxy = [(xy[i][0]-xy[j][0], xy[i][1]-xy[j][1])
           for i in range(n)
           for j in range(i+1, n)]
    cdxy = Counter(dxy)
    result = n - max(cdxy.values())
print(result)
N = int(input())
D = list(map(int, input().split()))
#print(D)
sum = 0
for i in range(N):
  for j in range(i+1,N):
    sum += D[i]*D[j]

print(sum)



### FIXED CODE ###

A,B = map(int, input().split())
print(max(0, A-2*B))
n = input()
n[0:4] = '2018'
print(n)

### FIXED CODE ###

print('2018'+input()[4:])
n = int(input())
s = str(input())
k = int(input())

c = s[k]

out = ""

for i in s:
    if i == c:
        out += i
    else:
        out += "*"

print(out)

### FIXED CODE ###

n = int(input())
s = str(input())
k = int(input())-1

c = s[k]

out = ""

for i in s:
    if i == c:
        out += i
    else:
        out += "*"

print(out)
dp=[[0 for j in range(10)] for i in range(10)]

h,w=map(int,input().split())
for i in range(10):
    s=list(map(int,input().split()))
    for j in range(10):
        dp[i][j]=s[j]

for k in range(10):
    for i in range(10):
        for j in range(10):
            dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j])
c=0
for i in range(h):
    s=list(map(int,input().split()))
    for j in range(w):
        if s[j]==-1 or s[j]==1:
            continue
        else:
            c+=dp[s[j]][i]
print(c)


### FIXED CODE ###

dp=[[0 for j in range(10)] for i in range(10)]

h,w=map(int,input().split())
for i in range(10):
    s=list(map(int,input().split()))
    for j in range(10):
        dp[i][j]=s[j]

for k in range(10):
    for i in range(10):
        for j in range(10):
            dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j])
c=0
for i in range(h):
    s=list(map(int,input().split()))
    for j in range(w):
        if s[j]!=-1 and s[j]!=1:
            c+=dp[s[j]][1]
print(c)
s = list(input())
renzoku = 0
renli = []
for i in s:
    if i == "A" or i == "T" or i == "C" or i == "G":
        renzoku += 1
        renli.append(renzoku)
    else:
        renzoku = 0
print(max(renli))

### FIXED CODE ###

s = list(input())
renzoku = 0
count = 0
hu_renzoku = 0
renli = []
for i in s:
    count += 1
    if i == "A" or i == "T" or i == "C" or i == "G":
        renzoku += 1
        renli.append(renzoku)
    else:
        renzoku = 0
        hu_renzoku += 1
if count == hu_renzoku:
    print(0)
else:
    print(max(renli))
import string
s = list(set(list(input())))
s.sort()
comp = string.ascii_lowercase
if len(s) == len(comp):
    ans = 'None'
else:
    for i, j in zip(s, string.ascii_lowercase):
        if i != j:
            ans = j
            break
print(ans)


### FIXED CODE ###

import string
s = set(list(input()))
ans = 'None'
for c in string.ascii_lowercase:
    if not c in s:
        ans = c
        break

print(ans)
import numpy as np


def main():
    N, M, X = map(int, input().split())

    books = np.array([list(map(int, input().split())) for _ in range(N)])

    min_total_cost = 10**9

    for i in range(2**N):
        to_read_indexes = np.array(list(str(i)), dtype=int)
        to_read_books = books[to_read_indexes, :]
        total_cost = to_read_books[:, 0].sum()
        increased_levels = to_read_books[:, 1:].sum(axis=0)

        if min(increased_levels) >= X:
            min_total_cost = min(min_total_cost, total_cost)

    if min_total_cost == 10**9:
        print('-1')
    else:
        print(min_total_cost)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# import numpy as np
# import queue
# import heapq


def main():
    N, M, X = map(int, input().split())

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

    min_total_cost = 10**9
    for i in range(2**N):
        total_cost = 0
        learned = [0] * M

        for j in range(N):
            if (i >> j) & 1:
                C, *As = books[j]
                total_cost += C

                for ids, a in enumerate(As):
                    learned[ids] += a

        if min(learned) >= X:
            min_total_cost = min(min_total_cost, total_cost)

    if min_total_cost == 10**9:
        print('-1')
    else:
        print(min_total_cost)


if __name__ == "__main__":
    main()
N=int(input())
A=int(input())
print("Yes" if (N-a)%500 else "No")

### FIXED CODE ###

N=int(input())
A=int(input())
count=0
for i in range(0, A+1):
    if (N-i)%500 == 0:
        count=1
        break
print("Yes" if count==1 else "No")
a=input().split()
del a[0]
for i in range(0,len(a)):
    a[i]=int(a[i])
c=sum(a)/2
d=0
e=0
for i in range(0,len(a)):
    if d<c:
        d=d+a[i]
        e=e+1
g=d*2-sum(a)
h=sum(a)-2*(d-a[e-1])
min(g,h)

### FIXED CODE ###

b=input()
a=input().split()
for i in range(0,len(a)):
    a[i]=int(a[i])
b=0
c=0
answer=sum(a)
for i in range(0,len(a)):
    b=b+a[i]
    c=sum(a)-b
    if (b-c>=0 and answer>b-c):
        answer=b-c
    elif (c-b>0 and answer>c-b):
        answer=c-b
print(answer)
s = str(input())
N = int(S)
S = sum(list(s))
if N % S == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
s = list(str(N))
S = 0
for i in range(len(s)):
    S += int(s[i])

if N % S == 0:
    print("Yes")
else:
    print("No")
from collections import deque
N,M=map(int,input().split())
A=[]
B=[]
road=[[] for i in range(M)]
for i in range(M):
  a,b=map(int,input().split())
  road[a-1].append(b-1)
  road[b-1].append(a-1)
visit=[0]*N

q=deque([0])
ans=[0]*N
visit[0]=1
#print(road)
#print(road[1])
def bfs(q):
  while(q):
    v=q.popleft()
    #print(v)
    for x in road[v]:
      if(visit[x]==0):
        q.append(x)
        #print(q)
        visit[x]=1
        ans[x]=v+1
        #print(x)
bfs(q)
print("Yes")
for i in range(N-1):
  print(ans[i+1])

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**7)
N,M=map(int,input().split())
A=[]
B=[]
road=[[] for i in range(N)]
for i in range(M):
  a,b=map(int,input().split())
  road[a-1].append(b-1)
  road[b-1].append(a-1)
visit=[0]*N

q=deque([0])
ans=[0]*N
visit[0]=1
def bfs(q):
  while(q):
    v=q.popleft()
    #print(v)
    for x in road[v]:
      if(visit[x]==0):
        q.append(x)
        #print(q)
        visit[x]=1
        ans[x]=v+1
        #print(x)
bfs(q)
print("Yes")
for i in range(N-1):
  print(ans[i+1])
a = list(map(int,input().split("/"))

if a[0]== 2019 and a[1]<=430 or a[0]<2019 :
    print('Heisei')
else:
   print('TBD')

### FIXED CODE ###

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



if a[0]== 2019 and a[1]<5:
    print("Heisei")
elif a[0]<2019 and a[1]< 12:
    print("Heisei")
else:
    print("TBD")
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
inp=[a,b,c,d,e]
i=0;
j=0;
kek=true
while i<5:
  j=i
  while j<5:
    if inp[j]-inp[i]>k:
      kek=false
      
print "Yay!" if kek else print ":("    

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if (e-a)> k:
  print(":(")
else:
  print("Yay!")
N = int(input())
T = list(map(int,input().split()))
M = int(input())
grid = []
for i in range(M):
    data = list(map(int,input().split()))
    grid.append(data)
fsum = sum(T)

for i in range(M):
    dsum = 0
    dsum = fsum - T[i] + grid[i][1]
    print(dsum)
    





### FIXED CODE ###

L = list(input().split())
A=int(L[0])
B=int(L[2])
if L[1]=="+":
    print(A+B)
elif L[1]=="-":
    print(A-B)
import math
a, b, h, m = map(int, input().split())
time = m + h*60
angle = time * 0.5 - time * 6
radian = math.radians(angle)
rad = math.cos(radian)
ans = b**2 + c**2 - 2*a*b*rad
print(math.sqrt(ans))

### FIXED CODE ###

import math
a, b, h, m = map(int, input().split())
time = m + h*60
angle = time * 0.5 - time * 6
radian = math.radians(angle)
rad = math.cos(radian)
ans = a**2 + b**2 - 2*a*b*rad
print(math.sqrt(ans))
# Hariom_Pandey
# 11.11.2019
from functools import reduce
import math as mt
import sys
n = int(sys.stdin.readline())
H = list(map(int,sys.stdin.readline().split()))
print(reduce(mt.gcd,H))

### FIXED CODE ###

# Hariom_Pandey
# 11.11.2019
from functools import reduce
from fractions import gcd
import sys
n = int(sys.stdin.readline())
H = list(map(int,sys.stdin.readline().split()))
print(reduce(gcd,H))
N = input().strip()
print('Yes' if N % sum(map(int, N)) == 0 else 'No')


### FIXED CODE ###

N = input().strip()
print('Yes' if int(N) % sum(map(int, N)) == 0 else 'No')
s = input()

for i in range(1, len(s)):
    if s[i] == 'B':
        continue
    else:
        if s[i - 1] != 'B':
            ans += s[i - 1]
if s[-1] != 'B':
    ans += s[-1]

print(ans)

### FIXED CODE ###

s = input()

pos = s.find('B')
while pos > -1:
    if pos == 0:
        s = s[1:]
    elif pos == len(s) - 1:
        s = s[0:pos - 1]
    else:
        s = s[0:pos - 1] + s[pos + 1:]
    pos = s.find('B')
print(s)
from subprocess import*;a,b=[set(Popen(('factor',x),stdout=PIPE).stdout.read().split())for x in input().split()[1:]];print(len(a&b)+1)

### FIXED CODE ###

from subprocess import*
a,b=map(int,input().split())
x=set(map(int,Popen(['factor',str(a)],stdout=PIPE).communicate()[0].decode().split()[1:]))
y=set(map(int,Popen(['factor',str(b)],stdout=PIPE).communicate()[0].decode().split()[1:]))
print(len(x&y)+1)
def calcH(x, cx, y, cy, h):
    return abs(x-cx)+abs(y-cy)+h
n = int(input())
xyh = [list(map(int, input().split())) for i in range(n)]
Hmax = 10**9
for i in range(101):
    for j in range(101):
        k = 0
        flag = True
        for x, y, h in xyh:
            H_ = calcH(x, i, y, j, h)
            if h == 0:
                flag = False if n != 1
            if k > 0:
                if H_ != H and flag:
                    flag = False
                    break
                elif H_ != H:
                    H = H_
                    flag = True
                else:
                    flag = True
                    continue
            else:
                H = H_
            k += 1
        if flag == False or H > Hmax:
            continue
        else:
            Cx = i
            Cy = j
            Ch = H
            break
    else:
        continue
    break
print(Cx, Cy, Ch)

### FIXED CODE ###

def calcCh(cx, cy, x, y, h):
    return abs(x-cx)+abs(y-cy)+h
def calcH(cx, cy, ch, x, y, h):
    return max(ch - calcCh(cx, cy, x, y, 0), 0)
n = int(input())
xyh = [list(map(int, input().split())) for i in range(n)]
xyh = sorted(xyh, key = lambda x: x[2])[::-1]
lst = [[x, y] for x in range(101) for y in range(101)]
for Cx, Cy in lst:
    Ch = calcCh(Cx, Cy, *xyh[0])
    if all(xyh[i][2] == calcH(Cx, Cy, Ch, *xyh[i]) for i in range(n)):
        break
print(Cx, Cy, Ch)
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
w=[[] for i in range(m-1)]
for i in range(m-1):
    w[i]=[x[i],x[i+1]-x[i]]
w=sorted(w,key=lambda y:y[1])
w.reverse()
skip=[]
for i in range(n-1):
    skip.append(w[i])
skip=sorted(skip,key=lambda y:y[0])
ans=[]
k=x[0]
for i in skip:
    ans.append(i[0]-k)
    k=i[0]+i[1]
ans.append(x[m-1]-k)
print(sum(ans))


### FIXED CODE ###

n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
w=[[] for i in range(m-1)]
for i in range(m-1):
    w[i]=[x[i],x[i+1]-x[i]]
w=sorted(w,key=lambda y:y[1])
w.reverse()
skip=[]
if m!=1:
    for i in range(n-1):
        skip.append(w[i])
        if i==m-2:
            break
            
    skip=sorted(skip,key=lambda y:y[0])
ans=[]
k=x[0]
for i in skip:
    ans.append(i[0]-k)
    k=i[0]+i[1]
ans.append(x[m-1]-k)
print(sum(ans))
tep = input()
if tep>=30:
	print('Yes')
else:
	print('No')

### FIXED CODE ###

temp = input()
temp = int(temp)
if temp<-40 or temp>40:
    print('Out')    
elif temp >=30: 
    print('Yes')
else:
    print('No')
n=int(input())
print(n.replace("1","9").replace("9","1").replace("1","1").replace("9","9"))


### FIXED CODE ###

print(input().replace("1","*").replace("9","1").replace("*","9"))
n,a,b=map(int,input().split())
c=0
d=0
if a==0:
	print(0)
else:
	if n>=(a+b):
		c=n//(a+b)
		d=a*c+n-c*(a+b)
		print(d)
	else:
		if n>=a:
			c=n//a
			ptint(a*c)
		else:
			print(a)

### FIXED CODE ###

n,a,b=map(int,input().split())
c=n//(a+b)
d=0
if a==0:
	print(0)
else:
	if n>=(a+b):
		if n-c*(a+b)<=a:
			d=a*c+n-c*(a+b)
			print(d)
		else:
			d=a*(c+1)
			print(d)
	else:
		if n>=a:
			print(a)
		else:
			print(n)
from math import sqrt
from decimal import *

getcontext().prec = 40000

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

tmp = 2 * sqrt(Decimal(a)) * sqrt(Decimal(b))
print("Yes" if Decimal(a) ** 0.5 + Decimal(b) ** 0.5 < Decimal(c) ** 0.5 else "No")


### FIXED CODE ###

from math import sqrt
from decimal import *


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

tmp = 2 * sqrt(Decimal(a)) * sqrt(Decimal(b))
print("Yes" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else "No")
a, b = list(input())

if a=='H':
	if b=='H':
		print('H')
	else:
		print('D')
else:
	if b=='H':
		print('D')
	else:
		print('H')

### FIXED CODE ###

a, b = input().split()

if a=='H':
	if b=='H':
		print('H')
	else:
		print('D')
else:
	if b=='H':
		print('D')
	else:
		print('H')
x, a = map(int,rfile.readline().split())
if x<a:
    print(0)
    else:
    print(10)

### FIXED CODE ###

x, a = map(int,input().split())
if x<a:
    print(0)
else:
    print(10)
S = list(input())

for i,c in enumerate(S):
    if len(S[i:]) == 2:
        subset = S[i:i+1]
        if subset[0] == subset[1]:
            print("%d %d" % (i+1, i+2))
            break   
        continue    
        
    elif len(S[i:]) > 2:
        subset = S[i:i+3]
        if subset[0] in subset[1:] or subset[1] == subset[2]:
            print("%d %d" % (i+1, i+3))    
            break
        continue   

    else:
        print("-1 -1")

### FIXED CODE ###

import sys
S = list(input())
if len(S) == 2 and S[0] == S[1]:
    print("%d %d" % (1, 2))
    sys.exit()

for i in range(len(S) - 2):
    subset = S[i:i+3]
    if subset[0] == subset[2] or subset[1] == subset[2]:
        print("%d %d" % (i+1, i+3))    
        sys.exit()

print("-1 -1")
n,s=open(0).read().split();n=int(n);print(max(0,*[s[:n].count(i)-s[n:].count(i)for i in s[:n]]))

### FIXED CODE ###

I=lambda:[input()for _ in[0]*int(input())];s=I();t=I();print(max([0]+[s.count(i)-t.count(i)for i in set(s)]))