Harryxun/stf_run huggingface dataset:
def main():
  s = ''.join(reversed(input()))
  multiplier = 1
  divisor = 10 ** 9 + 7
  list10 = list(range(10))
  list13 = list(range(13))
  p = [0 for i in list13]
  np = [0 for i in list13]
  rt = [i % 13 for i in range(120)]
  p[0] = 1
  for i in range(len(s)):
    multiplier = rt[10 * multiplier]
    if s[i] != '?':
      r = rt[int(s[i]) * multiplier]
      for j in list13:
        np[rt[j + r]] = p[j]
    else:
      r = 0
      for j in list10:
        for k in list13:
          np[rt[k + r]] += p[k]
        r = rt[r + multiplier]
    for j in list13:
      p[j] = np[j] % divisor
      np[j] = 0
  print(p[5])
main()

### FIXED CODE ###

s = ''.join(reversed(input()))
multiplier = 1
divisor = 10 ** 9 + 7
p = [0 for i in range(13)]
if s[0] != '?':
  p[int(s[0])] = 1
else:
  for j in range(10):
    p[j] = 1
for i in range(1, len(s)):
  multiplier = (10 * multiplier) % 13
  np = [0 for j in range(13)]
  if s[i] != '?':
    r = int(s[i]) * multiplier
    for j in range(13):
      np[(j + r) % 13] = p[j]
  else:
    for j in range(10):
      r = j * multiplier
      for k in range(13):
        np[(k + r) % 13] += p[k]
  for j in range(13):
    p[j] = np[j] % divisor
print(p[5] % divisor)
a,b=input().split()

print("H" if a==b else"D)

### FIXED CODE ###

a,b=input().split()

print("H" if a==b else"D")
x,y = map(int,input().split())	
c=input()
c.split()
print(y)
count=0
for i in c:
    if(float(y) <= float(i)):
        count+=1
print(count)

### FIXED CODE ###

x,y = map(float,input().split())	
li = list(map(float,input().split()))	
count=0
for i in li:
    if(y <= i):
        count+=1
print(count)
x = input()
y = input()
	print(((int(x) + int(y)) * 2))
	print((int(x) * int(y))

### FIXED CODE ###

a ,b = input().split(' ')
print(int(a) * int(b),(int(a) * 2) + (int(b) * 2))
#!/usr/bin/env python3.4
# -*- coding: utf-8 -*-

# abc125_a
import fractions, functools, itertools

# input
n = int(input())
A = [int(s) for s in input().split()]
# get ans
def search_booby(B):
    b0 = [fractions.gcd(B[0], a) for a in B[1:]]
    b0.sort()
    return b0[1]
def gcd_list(l):
    return functools.reduce(fractions.gcd, l)
B = itertools.cycle(A)
Bs = itertools.tee(B, 2)
Bs = (list(itertools.islice(B, i, i+n)) for i, B in enumerate(Bs))
Bs = map(search_booby, Bs)
ans = max(Bs)
# output
print(ans)



### FIXED CODE ###

#!/usr/bin/env python3.4
# -*- coding: utf-8 -*-

# abc125_c
import fractions, functools, itertools

# input
n = int(input())
A = [int(s) for s in input().split()]
# get ans
gcd = fractions.gcd
L = list(itertools.accumulate(A, gcd))
R = list(itertools.accumulate(A[::-1], gcd))
R = R[::-1]
L.append(0)
R.append(0)
gs = [gcd(L[i-1], R[i+1]) for i in range(n)]
ans = max(gs)
# output
print(ans)
n = int(input())

clist = [None for _ in range(n)]
cnt   = 0

for i in range(n):
    clist[i] = Counter(input())

for i in range(n):
    if i < n:
        for j in range(i+1,n):
            if clist[i] == clist[j]:
                cnt += 1

print(cnt)

### FIXED CODE ###

from collections import Counter
# from fractions import gcd # >=Python3.5 # lcm（最小公倍数） = (a*b)//gcd(a,b)
# from fractions import Fraction
# from math import gcd # <Python3.5
# from math import sqrt

# input = sys.stdin.readline
# def main():

#---------------------------------------------------------

n = int(input())

clist = [''.join(sorted(input())) for _ in range(n)]

c = Counter(clist)

print(sum([v*(v-1)//2 for v in c.values()]))
from math import gcd
N = int(input())
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

sa = set(A)
if len(sa) < N:
    print('setwise coprime')
    exit()

MAXN = 10**10+10
sieve = [0,0] + [1]*MAXN
p = 2
small_primes = []
while p*p <= MAXN:
    if sieve[p]:
        small_primes.append(p)
        for q in range(2*p,MAXN+1,p):
            sieve[q] = 0
    p += 1

st = set()
for a in A:
    for p in small_primes:
        found = False
        while a%p==0:
            a //= p
            found = True
        if found:
            if p in st:
                print('setwise coprime')
                exit()
            st.add(p)
        if a==1: break
    else:
        if a in st:
            print('setwise coprime')
            exit()
        st.add(a)

print('pairwise coprime')


### FIXED CODE ###

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

import math 

ans = a[0]
for i in range(1, n):
    ans = math .gcd(ans, a[i])

if ans!=1:
    #print(ans)
    print("not coprime")
    exit()
else:
    checked=[0]*(int(max(a))+1)
    #print(checked)
    for item in a:
        for j in range(1,int(item**0.5)+1):
            if item%j==0 and j*j<=item:
                if checked[j]==0:
                    if j!=1:
                        checked[j]+=1
                    
                    if j*j!=item:
                        if checked[item//j]==0:
                            checked[item//j]+=1
                        else:
                            #print(item,j,checked)
                            print("setwise coprime")
                            exit() 
                else:
                    #print(item,j,checked)
                    print("setwise coprime")
                    exit()
print("pairwise coprime")
import math

def lcmCalc(x, y):
	return int((x * y) / math.gcd(x, y))

n, m = map(int, input().split())
s = input()
t = input()

lcm = lcmCalc(n, m)

str1 = ""
for i in range(lcm):
	str1 += "-"

for i in range(n):
	index = int(i * lcm / n + 1)
	str1 = str1[:index] + s[i] + str1[index+1:]

flg = 0
for i in range(m):
	index = int(i * lcm / m + 1)
	if str1[index:index+1] != "-" and str1[index:index+1] != t[i]:
		print("-1")
		flg = 1
		break

if flg == 0:
	print(lcm)

### FIXED CODE ###

def gcd(a, b):
	if a > b:
		a, b = b, a
	if a % b == 0:
		return b
	while a % b != 0:
		c = a% b
		a = b
		b = c
	else:
		return c

def lcmCalc(x, y):
	return (x * y) // gcd(x, y)

n, m = map(int, input().split())
s = input()
t = input()

lcm = lcmCalc(n, m)

# str1 = ""
# for i in range(lcm):
# 	str1 += "-"

flg = 0
for i in range(n):
	index = i * lcm // n + 1
	if (index - 1) % (lcm // m) == 0:
		j = (index - 1) // (lcm // m)
		if s[i] != t[j]:
			print("-1")
			flg = 1
			break
if flg == 0:
	print(lcm)


# 	str1 = str1[:index] + s[i] + str1[index+1:]

# flg = 0
# for i in range(m):
# 	index = i * lcm // m + 1
# 	if str1[index:index+1] != "-" and str1[index:index+1] != t[i]:
# 		print("-1")
# 		flg = 1
# 		break

# if flg == 0:
# 	print(lcm)
from itertools import product
n,m = map(int,(input().split()))
sw =[list(map(int, input().split())) for _ in range(m)]
p = list(map(int, input().split()))

ans = 0
for bit in product([0, 1], repeat=n):
    onoff = [1] * n # 1がon 0がoff
    ele = True
    for i, j in enumerate(bit):
        if j == 1:
            onoff[i] = 0
    #switchの状態を確認
    #print(bit,i,j)
    for k in range(m):
        cnt = 0
        #print(onoff)
        for l in range(sw[0][k]): #電球のループ
            if onoff[sw[k][l]-1]  == 1:
                cnt += 1
        if cnt % 2 != p[m-1]:
            ele = False
            break
    if ele :
        #print(i,j,k,l)
        ans += 1

        
print(ans)

### FIXED CODE ###

import itertools
n,m = map(int,(input().split()))
sw =[list(map(int, input().split())) for _ in range(m)]
p = list(map(int, input().split()))
result = 0

for i in itertools.product([0, 1], repeat=n):
    onof = True
    for j in range(m):
        counter = 0
        for k in sw[j][1:]:
            counter += i[k-1]
        if counter % 2 != p[j]:
            onof = False
            break
    if onof:
        result += 1
print(result)
n = input()
s = input()
x = 0
y = 0

for i in range(n):
  if s[i] == "I":
    y += 1
    x = max(x,y)
  if s[i] == "D":
    y = y - 1

print(x)

### FIXED CODE ###

input()
s=input()
c,m=0,0
for i in range(len(s)):
    if s[i]=="I":
        c+=1
        m=max(c,m)
    if s[i]=="D":
        c=c-1
        m=max(c,m)
print(m)
x,n = map(int, input().split())
if n ==0:
  print(x)
if n != 0:
  i = list(map(int, input().split()))


  
if x not in i:
  print(x)
  break
  
else:
  p = 1
  while True:
    z = x - p
    if z not in i:
      print(z)
      break
        
    z = x + p
    if z not in i:
      print(z)
      break
        
    p = p +1
        

### FIXED CODE ###

x,n = map(int, input().split())
if n ==0:
  print(x)
if n != 0:
  i = list(map(int, input().split()))


  
  if x not in i:
    print(x)
  
  else:
    p = 1
    while True:
      z = x - p
      if z not in i:
        print(z)
        break
        
      z = x + p
      if z not in i:
        print(z)
        break
        
      p = p +1
print(["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"][int(input())+22]) 

### FIXED CODE ###

print(["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"][int(input())-22])
n= int(input())
a = list(map(int,input().split()))
s=0
k=0
top=[]
bottom=[]
t=0
ans=1000
ka=0
while a[s]==a[s+1] and s<n-1:
    s+=1
if s==n-1:
    print(ans)
else:
    if a[s]>a[s+1]:
        k=-1
        t=1
    else:
        k=1

    while s<n-1:
        while a[s]*k <= a[s+1]*k and s<n-1:
            s+=1
            if s==n-1:
                break
        if k ==-1:
            bottom.append(a[s])
        else:
            top.append(a[s])
        k *= -1
        s+=1
    if k == 1:
        top.append(a[-1])
    else:
        bottom.append(a[-1])
    if t==1:
        for i in range(len(top)):
            ka+=ans//bottom[i]
            ans = ans % bottom[i]
            ans += ka*top[i]
            ka = 0
    else:
        for i in range(len(top)):
            
            if i== 0:
                ka += ans // a[i]
                ans = ans % a[i]
                ans += ka * top[i]
                ka = 0
            else:
                ka+=ans//bottom[i-1]
                ans = ans % bottom[i-1]
                ans += ka*top[i]
                ka = 0
    print(ans)

### FIXED CODE ###

n= int(input())
a = list(map(int,input().split()))
s=0
k=0
top=[]
bottom=[]
t=0
ans=1000
ka=0
while a[s]==a[s+1] and s<n-1:
    s+=1
    if s == n - 1:
        break
if s==n-1:
    print(ans)
else:
    if a[s]>a[s+1]:
        k=-1
        t=1
    else:
        k=1

    while s<n-1:
        while a[s]*k <= a[s+1]*k and s<n-1:
            s+=1
            if s==n-1:
                break
        if k ==-1:
            bottom.append(a[s])
        else:
            top.append(a[s])
        k *= -1
        s+=1
    if k == 1:
        top.append(a[-1])
    else:
        bottom.append(a[-1])
    if t==1:
        for i in range(len(top)):
            ka+=ans//bottom[i]
            ans = ans % bottom[i]
            ans += ka*top[i]
            ka = 0
    else:
        for i in range(len(top)):

            if i== 0:
                ka += ans // a[i]
                ans = ans % a[i]
                ans += ka * top[i]
                ka = 0
            else:
                ka+=ans//bottom[i-1]
                ans = ans % bottom[i-1]
                ans += ka*top[i]
                ka = 0
    print(ans)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

ls = [int(x) for x in input().split()]
ls.sort()
print(int((ls[0]*ls[1])/2)


### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

ls = [int(x) for x in input().split()]
ls.sort()
print(int((ls[0]*ls[1])/2))
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
b = [0]*n
for i in range(n):
    sa = a[i] - (i+1)
    b[i] = sa
b.sort()
idx = int(n/2) -  (n%2)^1

p = b[idx]
ans = 0
for i in range(n):
    ans += abs(i+1+p-a[i])
print(ans)




### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int,input().split()))
b = [0]*n
for i in range(n):
    sa = a[i] - (i+1)
    b[i] = sa
b.sort()
idx = int(n/2) 

p = b[idx]
ans = 0
for i in range(n):
    ans += abs(i+1+p-a[i])
print(ans)
import sys
     
A=[]
fp =0
bp =0
 
n=int(raw_input())
while n:
    s = raw_input()
    if s[0] == 'i':
        A.append(int(s[7:]))
        fp += 1
    elif s[6] == ' ':
        try:
            i = A[::-1].index(int(s[7:]))
            if i!=-1:
                del A[-i-1]
                fp -=1
        except:
            pass
    elif s[6] == 'F':
        A.pop()
        fp -=1
    elif s[6] == 'L':
        bp +=1
    n -=1
 
for e in A[bp:fp+1][::-1]:
    print int(e),


### FIXED CODE ###


import sys
     
A=[]
fp =0
bp =0
 
n=int(raw_input())
while n:
    s = raw_input()
    if s[0] == 'i':
        A.append(int(s[7:]))
        fp += 1
    elif s[6] == ' ':
        try:
            i = A[::-1].index(int(s[7:]))
            if i!=-1:
                del A[-i-1]
                fp -=1
        except:
            pass
    elif s[6] == 'F':
        A.pop()
        fp -=1
    elif s[6] == 'L':
        bp +=1
    n -=1
 
for e in A[bp:fp+1][::-1]:
    print int(e),
import sys
input = sys.stdin.readline

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

A = [list(map(int,input().split())) for i in range(H)]
B = [list(map(int,input().split())) for i in range(H)]

C = [[0]*W for i in range(H)]

for h in range(H):
    for w in range(W):
        C[h][w] = abs(A[h][w] - B[h][w])
        
#print(C)

ZZZ = 80*73

DP = [[[0]*ZZZ for i in range(W)] for j in range(H)]

for j in range(H*W):
    h = j//H
    w = j%H
    if h==0 and w==0:
        DP[h][w][C[h][w]] = 1
    elif h==0:
        for i in range(ZZZ):
            tmp = DP[h][w-1][i]
            DP[h][w][abs(i-C[h][w])] = tmp
            if i+C[h][w]<ZZZ:
                DP[h][w][abs(i+C[h][w])] = tmp
    elif w==0:
        for i in range(ZZZ):
            tmp = DP[h-1][w][i]
            DP[h][w][abs(i-C[h][w])] = tmp
            if i+C[h][w]<ZZZ:
                DP[h][w][abs(i+C[h][w])] = tmp
    else:
        for i in range(ZZZ):
            tmp = DP[h-1][w][i]
            tmp2 = DP[h][w-1][i]
            DP[h][w][abs(i-C[h][w])] = tmp|tmp2
            if i+C[h][w]<ZZZ:
                DP[h][w][abs(i+C[h][w])] = tmp|tmp2
                
for i in range(ZZZ):
    if DP[H-1][W-1][i]==1:
        ans = i
        break
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

A = [list(map(int,input().split())) for i in range(H)]
B = [list(map(int,input().split())) for i in range(H)]

C = [[0]*W for i in range(H)]
M = 0

for h in range(H):
    for w in range(W):
        C[h][w] = abs(A[h][w] - B[h][w])
        
#print(C)

c = 80*(H+W-1)+1

DP = [[0]*W for j in range(H)]

for h in range(H):
    for w in range(W):
        if h==0 and w==0:
            DP[h][w] = 1 << (C[h][w]+c)
        elif h==0:
            DP[h][w] = (DP[h][w-1] << C[h][w]) | (DP[h][w-1] >> C[h][w])
        elif w==0:
            DP[h][w] = (DP[h-1][w] << C[h][w]) | (DP[h-1][w] >> C[h][w])
        else:
            DP[h][w] = (DP[h][w-1] << C[h][w]) | (DP[h][w-1] >> C[h][w]) | (DP[h-1][w] << C[h][w]) | (DP[h-1][w] >> C[h][w])

ans = float('inf')
now = DP[H-1][W-1]
tmpans = -c
while now != 0:
    if now%2==1:
        ans = min(ans,abs(tmpans))
    tmpans += 1
    now = now >> 1

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

ans = 0
k_list = []

flag = True

while k > 0:
    if len(a) > 0 and a[0] <= b[0]:
        k -= a.pop(0)
        ans += 1
    else:
        k -= b.pop(0)
        ans += 1
    if len(a) == 0 and len(b) == 0:
        flag = False
        break

if flag:
    print(ans-1)
else:
    print(ans)

### FIXED CODE ###

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

a, b = [0], [0]

# 累積和を求める
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans = 0
# bを全部読む
j = M

for i in range(N + 1):
    # aは0冊から始まる
    if a[i] > K:
        break

    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)
    
    
print(ans)
n= int(input())
    lista=[]
    listanova=[]
    for x in input().split():
    	x= int(x)
    	if x %2 ==0:
    		lista.append(x)
    for x in lista:
    	if x %3==0 or x%5==0:
    		listanova.append(x)
     
    if len(lista)==len(listanova):
    	print('APPROVED')
    else:
    	print('DENIED')

### FIXED CODE ###

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

if (a==b and c==b) or (a!=b and b!=c and c!=a):
	print('No')
else:
	print('Yes')
L, R= map(int, input().split())
L, R = L%2019, R%2019
ans = []
for i in range(L, R):
    for j in range(i+1, R+1):
        ans.append((i*j)%2019)
print(min(ans))

### FIXED CODE ###

import sys
L, R= map(int, input().split())
ans = []
for i in range(L, R):
    for j in range(i+1, R+1):
        if (i*j)%2019 == 0:
            print(0)
            sys.exit()
        else:
            ans.append((i*j)%2019)
print(min(ans))
from math import *
a,b,c = int(input().split())
print("%f %f %f" %(b*cos(radians(c))*a/2,a+b+b*sin(radians(c)),b*sin(radians(c))))


### FIXED CODE ###

from math import *
a,b,c = map(int,input().split())
c = radians(c)
S = a*b*sin(c)/2
print("%.10f %.10f %.10f" %(S,a+b+sqrt(a*a+b*b-2*a*b*cos(c)),2*S/a ))
import math
def dot(a, b):
  return a.real * b.real + a.imag * b.imag

def projection(p0,p1,p2):
  a=p1-p0
  b=p2-p0
  pro = a * dot(a, b) / (abs(a) ** 2)
  t=p0+pro
  return t

def get_cross_point(p0,p1,p2):
  pro=projection(p0,p1,p2)
  e  =(p1-p0)/abs(p1-p0)
  base = math.sqrt(r*r-(abs(pro-p2)**2))
  if pro-e*base.real == pro+e*base.real:
    ans1=min(pro-e*base,pro+e*base,key=lambda x:x.image)
    ans2=max(pro-e*base,pro+e*base,key=lambda x:x.image)
  else:
    ans1=min(pro-e*base,pro+e*base,key=lambda x:x.real)
    ans2=max(pro-e*base,pro+e*base,key=lambda x:x.real)
  return ans1.real, ans1.imag,ans2.real,ans2.imag


cx, cy, r = map(int, input().split())
p2=complex(cx,cy)
q = int(input())
for _ in range(q):
  x0,y0,x1,y1=map(int,input().split())
  p0=complex(x0,y0)
  p1=complex(x1,y1)
  print(*get_cross_point(p0,p1,p2))


### FIXED CODE ###

cx, cy, r = map(int, input().split())
q = int(input())

for _ in range(q):
  x1,y1,x2,y2 = map(int,input().split())
  dx, dy = x2 - x1, y2 - y1
  px, py = cx - x1, cy - y1
  s2 = dx **2 + dy **2
  dot = dx*px + dy*py
  crs = dx * py - dy * px
  t1 = (dot + (s2 * r ** 2 - crs ** 2) **0.5)/s2
  t2 = (dot -(s2 * r ** 2 -crs ** 2) ** 0.5)/s2
  if (dx < 0 or (dx == 0 and dy < 0 )) ^ (t1 > t2):
    t1,t2 = t2,t1
  print(x1+dx*t1, y1+dy*t1,x1+dx*t2,y1+dy*t2)
_,b,c,d,*e=map(int,open(0).read().split());print((c<max(e[:b])<min(e[b:]<d))*"No "+"War")

### FIXED CODE ###

n,m,x,y=map(int,input().split())
zmin=max(map(int,input().split()))
zmax=min(map(int,input().split()))
if max(zmin,x)<min(zmax,y):
    print("No War")
else:
    print("War")
a, b = [int(i) in input().split(" ")]
c = a/b
print(int(a/b), a%b, "{0:.5f}.format(c), sep = " ")

### FIXED CODE ###

a, b = [int(i) for i in input().split(" ")]
num1 = a // b
num2 = a % b
num3 = "{:.8f}".format(a / b)

print(num1, num2, num3)
import math
import sys

N = int(sys.stdin.readline())

min_leaf_cnt = math.inf

class Node:
    def __init__(self, N, cnt, v):
        self.N = N
        self.cnt = cnt
        self.v = v
        self.left = None
        self.right = None
        if self.cnt < min_leaf_cnt:
            self._fill_leaf()

    def _fill_leaf(self):
        if self.N >= 6:
            v = math.pow(6, math.floor(math.log(self.N, 6)))
            self.left = Node(self.N - v, self.cnt + 1, v)
        if self.N >= 9:
            v = math.pow(9, math.floor(math.log(self.N, 9)))
            self.right = Node(self.N - v, self.cnt + 1, v)
        if self.left is None and self.right is None:
            global min_leaf_cnt
            if self.cnt + self.N < min_leaf_cnt:
                min_leaf_cnt = self.cnt + int(self.N)

Node(N, 0, 0)
print(min_leaf_cnt)

### FIXED CODE ###

import itertools
import math
import sys

MAX_N = 100000
MAX_LOG6 = int(math.log(MAX_N, 6))
MAX_LOG9 = int(math.log(MAX_N, 9))

def main(N):
    dp = [MAX_N] * (N + 1)
    for i in range(min(N + 1, 6)):
        dp[i] = i
    for i in range(N + 1):
        t = 1
        for j in range(1, MAX_LOG6 + 1):
            t *= 6
            if i - t < 0:
                break
            dp[i] = min(dp[i], dp[i - t] + 1)
        t = 1
        for j in range(1, MAX_LOG9 + 1):
            t *= 9
            if i - t < 0:
                break
            dp[i] = min(dp[i], dp[i - t] + 1)
    print(dp[N])

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    main(N)
s = input()
for i in range(4):
  if s[i] != s[i+1]:
    print("Bad")
    exit()
print("Good")

### FIXED CODE ###

s = input()
for i in range(3):
  if s[i] == s[i+1]:
    print("Bad")
    exit()
print("Good")
def cul_even(x):
  return x // 2 * 25
def cul_odd(x):
  return x // 2 * 25 + 13
def test(a, b, func):
  if(b == func(a)//10):
      print(func(a))
    elif(b == (func(a)//10 + 1)):
      print((func(a)+12)//10*10)
    else:
      print(-1)

def main():
  a,b = map(int,input().split())
  if(a % 2 == 0):
    test(a, b, cul_even)
  else:
    test(a, b, cul_odd)

if __name__ == '__main__':
  main()  


### FIXED CODE ###

def cul_even(x):
  return x // 2 * 25
def cul_odd(x):
  return x // 2 * 25 + 13
def main():
  a,b = map(int,input().split())
  if(a % 2 == 0):
    if(b == cul_even(a)//10):
      print(cul_even(a))
    elif(b == (cul_even(a)//10 + 1)):
      print((cul_even(a)+12)//10*10)
    else:
      print(-1)
  else:
    if(b == cul_odd(a)//10):
      print(cul_odd(a))
    elif(b == (cul_odd(a)//10 + 1)):
      print((cul_odd(a)+11)//10*10)
    else:
      print(-1)

if __name__ == '__main__':
  main()
n,k=map(int,input().split())
l=[input().split() for _ in range(n)]
ans=0
for a in range(0,k):
     for b in range(0,k):
         i=0
         total=0
         while i<n:
           m=(((int(l[i][0])-a)//k)+((int(l[i][1])-b)//k))%2
           if (m==0 and str(l[i][2])=="W") or (m==1 and str(l[i][2])=="B"):
               total=total+1
               i=i+1
           else:
               i=i+1

         else:
              ans=max(ans,total,n-total)
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2==0:
     print('Even')
else:
     print("Odd")
N = int(input())
A = list(map(float,input().split()))


for i in range(N):
 if(i == 0): ans = A[i]
 else: ans = ans*A[i]
  
ans = '{:.19g}'.format(ans)  
if((len(ans)>=2)and(ans[1] == 'e')):
  print('-1')
else:
  print(ans)
    

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
a,b=map(int,input().split())
print(max(a+b)+max(max(a+b)-1,min(a,b)))


### FIXED CODE ###

a,b=map(int,input().split())
print(max(a,b)+max(max(a,b)-1,min(a,b)))
import math
ls = [int(input()) for _ in range(5)]
ans = 0
num = []

for i in ls:
    ans += math.ceil(i/10)*10
    if str(i)[-1] != '0':
        num.append(str(i)[-1])

print(ans-10+min([int(i) for i in num]))


### FIXED CODE ###

import math
ls = [int(input()) for _ in range(5)]
ans = 0
num = []

for i in ls:
    ans += math.ceil(i/10)*10
    if str(i)[-1] != '0':
        num.append(str(i)[-1])

if num:
    print(ans-10+min([int(i) for i in num]))
else:
    print(ans)
a,b,c=[input() for _ in range(3)]
s=3*c
print(a,b,s-a-b)
print(2*s-2*a-b-2*c,c,2*a+b+c-s)
print(a+b+2*c-s,s-b-c,s-a-c)

### FIXED CODE ###

a,b,c=[int(input()) for _ in range(3)]
s=3*c
print(a,b,s-a-b)
print(2*s-2*a-b-2*c,c,2*a+b+c-s)
print(a+b+2*c-s,s-b-c,s-a-c)