Harryxun/stf_run huggingface dataset:
S=str(input())
ListNum=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUM=(Num-753)**2
    ListNum.append(Num)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))
print(int(NUM[posi]**(1/2)))


### FIXED CODE ###

S=str(input())
ListNum=[]
ListNUm=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUm=Num-753
    NUM=NUm**2
    ListNum.append(Num)
    ListNUm.append(NUm)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))

if ListNUm[posi]<0:
  ListNUm[posi]=ListNUm[posi]*(-1)
print(ListNUm[posi])
D,N = map(int, raw_input().split( ))

if N < 100:
	print pow(100,D)*N

else:
	print (N+1)*pow(100,d)

### FIXED CODE ###

D,N = map(int, raw_input().split( ))

if N < 100:
	print pow(100,D)*N

else:
	print (N+1)*pow(100,D)
n,m=map(int,input().split())
a=list(map(int,input().split()))
sa=sum(a)//n
c=0
if n==1:
    print(a[0]//(2**m))
    exit()
else:
    while True:
    a.sort()
    a1=a[:n//2]
    a2=a[n//2:]
    print(a1,a2)
    while True:
        if c==m:
            print(sum(a1)+sum(a2))
            exit()
        if len(a2)==0:
            a=a1
            break
        k=a2.pop(-1)
        while True:
            k=k//2
            c+=1
            if k<=sa:
                a1.append(k)
                print(a1,a2)
                break

### 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(m):
  min = heapq.heappop(a)
  heapq.heappush(a, (-min//2)*(-1))
print(-sum(a))
inputs = input()
a, b, c = input.split()
if a == b and b == c:
  return 'YES'
else:
  return 'No'

### FIXED CODE ###

x = input()
inputs = x.split()
a, b, c = int(inputs[0]), int(inputs[1]), int(inputs[2])

if a == b and b == c:
    print('Yes')
else:
    print('No')
N=int(input())
D={}
for i in range(N):
    D[i]=[input().split()]

cou=0
for i in range(N):
    if D[i][0]==D[i][1]:
        cou+=1
    else:
        cou=0
    if cou == 3:
        print('Yes')
        break

if cou == 0:
    print('No')


### FIXED CODE ###

N=int(input())
D={}
for i in range(N):
    D[i]=input().split()

cou=0
for i in range(N):
    if D[i][0]==D[i][1]:
        cou+=1
        if cou ==3:
            print('Yes')
            break
    else:
        cou=0

if cou < 3:
    print('No')
p=map(int,input().split());print('Yes'if p[0<=p[2]<=p[1]else'No')

### FIXED CODE ###

p=list(map(int,input().split()));print('Yes' if p[0]<=p[2]<=p[1] else 'No')
import numpy as np

n,m = map(int, input().split())
a = list(map(int, input().split()))
st = np.lcm.reduce(a)
ans = m // st
if (ans+0.5) * st <= m:
  ans += 1
b = np.zeros(n)


for i in range(0,n):
  while a[i] % 2 == 0:
    b[i] += 1
    a[i] = a[i] // 2



for i in range(1,n):
  for j in range(0,i):
    if b[i] != b[j]:
      ans = 0
      break

print(ans)

### FIXED CODE ###

from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)
# coding:utf-8

n = input()
top = map(int, raw_input().split())
middle = map(int, raw_input().split())
under = map(int, raw_input().split())
top.sort()
middle.sort()
under.sort()
total = 0
for i in xrange(n):
    high = n - 1
    low = 0
    t = (high+low)/2
    d = middle[i] - 1
    while(low <= high):
        if top[t] == d: break
        if top[t] > d:
            high = t - 1
        else:
            low = t + 1
        t = (high+low)/2
    while(t+1 < len(top)):
        if top[t] != top[t+1]: break
        t += 1
    tt = t + 1 #topの候補数

    high = n -1
    low = 0
    t = (high+low)/2
    d = middle[i] + 1
    while(low <= high):
        if under[t] == d: break
        if under[t] > d:
            high = t - 1
        else:
            low = t + 1
        t = (high+low)/2
    if(under[t] != d): t += 1
    while(t-1 >= 0):
        if under[t] != under[t-1]: break
        t -= 1
    tu = n - t #underの候補数

    total += tt*tu
print total



### FIXED CODE ###

# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N = int(input())
A = sorted(inpl())
B = sorted(inpl())
C = sorted(inpl())

ans = 0
i_a = 0
i_c = 0
for i_b in range(N):
    while i_a < N and A[i_a] < B[i_b]:
        i_a += 1
    while i_c < N and C[i_c] <= B[i_b]:
        i_c += 1

    ans += i_a * (N - i_c)

print(ans)
n,*p=map(int,open(0).read().split())
print(int(sum(p)-max(p)/2))

### FIXED CODE ###

print('Christmas'+' Eve'*(25-int(input())))
a=int(input())
if a<=1000:
    print("ABD"+(a-999))
else:
    print("ABC"+a)

### FIXED CODE ###

a=int(input())
if a>=1000:
    print("ABD")
else:
    print("ABC")
n = int(input())
a = list(map(int,input().split())
count =0
for i in range(n):
    for j in range(n-1,i,-1):
        if a[j] < a[j-1]:
            a[j],a[j-1] = a[j-1],a[j]
            count += 1
print(' '.join(map(str,a)))
print(count)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().strip().split()))
count = 0
for i in range(n):
    for j in range(n-1,i,-1):
        if a[j] < a[j-1]:
            a[j],a[j-1] = a[j-1],a[j]
            count += 1
print(' '.join(map(str,a)))
print(count)
a = input()
if a.count(7) == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a = input()
if a.count('7') == 0:
  print('No')
else:
  print('Yes')
import sys
import math

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

a = list(map(int,input().split()))
ans = lcm(a[0], a[1])

print(ans)

### FIXED CODE ###

import sys
import fractions

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

a = list(map(int,input().split()))
ans = lcm(a[0], a[1])

print(ans)
a = list(input())
b = list(input())
c = list(input())
A, B, C = map(len, (a, b, c))
OFFSET = 4000
L = 8001
ab = [True] * L
ac = [True] * L
bc = [True] * L

for i in range(A):
    for j in range(B):
        if a[i] != b[j] and a[i] != '?' and b[j] != '?':
            ab[i - j + OFFSET] = False  # BをAからi-jずらした時を考える

for i in range(A):
    for j in range(C):
        if a[i] != c[j] and a[i] != '?' and c[j] != '?':
            ac[i - j + OFFSET] = False  # CをAからi-jずらした時を考える

for i in range(B):
    for j in range(C):
        if b[i] != c[j] and c[i] != '?' and b[j] != '?':
            bc[i - j + OFFSET] = False  # CをBからi-jずらした時を考える

ans = float('inf')
for i in range(L):  # Bの左端をずらす
    for j in range(L):  # Cの左端をずらす
        k = j - i + OFFSET
        if k >= L or k < 0:
            continue
        if ab[i] and ac[j] and bc[k]:
            head = min(i, j, OFFSET)
            tail = max(A + OFFSET, B + i, C + j)
            ans = min(ans, tail - head)

print(ans)


### FIXED CODE ###

a = list(input())
b = list(input())
c = list(input())
A, B, C = map(len, (a, b, c))
OFFSET = 4000
L = 8001
ab = [True] * L
ac = [True] * L
bc = [True] * L

for i in range(A):
    for j in range(B):
        if a[i] != b[j] and a[i] != '?' and b[j] != '?':
            k = i - j + OFFSET
            ab[i - j + OFFSET] = False  # BをAからi-jずらした時を考える

for i in range(A):
    for j in range(C):
        if a[i] != c[j] and a[i] != '?' and c[j] != '?':
            ac[i - j + OFFSET] = False  # CをAからi-jずらした時を考える

for i in range(B):
    for j in range(C):
        if b[i] != c[j] and b[i] != '?' and c[j] != '?':
            bc[i - j + OFFSET] = False  # CをBからi-jずらした時を考える

ans = float('inf')
for i in range(L):  # Bの左端をずらす
    for j in range(L):  # Cの左端をずらす
        k = j - i + OFFSET
        if k >= L or k < 0:
            continue
        if ab[i] and ac[j] and bc[k]:
            head = min(i, j, OFFSET)
            tail = max(A + OFFSET, B + i, C + j)
            ans = min(ans, tail - head)

print(ans)
from collections import OrderedDict
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = collections.Counter(a)
ans = 0
num_keys = len(b.keys())

if num_keys > k:
    if k != 0:
        c = sorted(b.items(),key=lambda x:x[1])
        for i in range(len(c)):
            num_keys -= c[i][1]
#           c[-1][1] += c[i][1] 
            ans += c[i][1]
            if num_keys <= k:
                break
    else:
        ans += k
            
print(ans)

### FIXED CODE ###

from collections import Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
x = len(set(a))
if x <= k:
    print(ans)
else:
    b = Counter(a).most_common(x)
    for i in range(x-1,k-1,-1):
        ans += b[i][1]
    print(ans)
N, M = map(int, input().split());
xList =list(map(int, input().split()))
xList.sort();

if M == 1:
  print(0);
else:
  diff = xList[M - 1] - xList[1];

  diffList = [];
  prevX = xList[0];
  for i in range(1, M):
      x = xList[i];
      diffList.append(x - prevX);
      prevX = x;
  diffList.sort();

  for i in range(N - 1):
      diffList.pop();

  length = len(diffList);
  result = 0;
  for i in range(length):
      result += diffList[i];

  print(result);

### FIXED CODE ###

N, M = map(int, input().split());
xList =list(map(int, input().split()))
xList.sort();

if N >= M:
  print(0);
else:
  diff = xList[M - 1] - xList[1];

  diffList = [];
  prevX = xList[0];
  for i in range(1, M):
      x = xList[i];
      diffList.append(x - prevX);
      prevX = x;
  diffList.sort();

  for i in range(N - 1):
      diffList.pop();

  length = len(diffList);
  result = 0;
  for i in range(length):
      result += diffList[i];

  print(result);
x,y,z,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

ab=[]
for i in range(x):
    for j in range(y):
        ab.append(a[i]+b[j])
ab.sort()
aa=[]
for i in range(k):
    if x*y-i>=0:
        aa.append(ab[x*y-i])
ans=[]
for i in range(len(aa)):
    for j in range(z):
        ans.append(aa[i]+c[j])
ans.sort()
for i in range(k):
    print(ans[len(ans)-i-1])
        

### FIXED CODE ###

x,y,z,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

ab=[]
for i in range(x):
    for j in range(y):
        ab.append(a[i]+b[j])
ab.sort()
aa=[]
for i in range(k):
    if x*y-i-1>=0:
        aa.append(ab[x*y-i-1])
ans=[]
for i in range(len(aa)):
    for j in range(z):
        ans.append(aa[i]+c[j])
ans.sort()
for i in range(k):
    print(ans[len(ans)-i-1])
h, W = map(int,input().split())
if W <= 0:
    print(0)
elif h == 1:
    print(1)
elif W == 1:
    print(0)
else:
    if h % 2 != 0:
        if W % 2 != 0:
            ans = ((h-1)*W//2)+(W//2+1)
    else:
        ans = (h*W)//2
    print(ans)

### FIXED CODE ###

h, W = map(int,input().split())
if W <= 0:
    print(0)
elif h == 1:
    print(1)
elif W == 1:
    print(1)
else:
    if h % 2 != 0:
        if W % 2 != 0:
            ans = ((h-1)*W//2)+(W//2+1)
        else:
            ans = (h*W)//2
    else:
        ans = (h*W)//2
    print(ans)
N = int(input())
H = list(map(int, input().split()))
max_count = 0
for i in range(N-1):
  tmp_count = 0
  for j in range(i, N-1):
  	if H[j] >= H[j+1]:
      tmp_count=tmp_count+1
  if tmp_count > max_count:
    max_count = tmp_count
print(max_count)

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
tmp = 0
s = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    tmp += 1
    s = max(s, tmp)
  else:
    tmp = 0
    
print(s)
n,a,b = map(int,input().split())

if (b-a) % 2 == 0:
	print((b-a) // 2)
else:
	if a-1 < n-b:
		ans = b-1
		x = b-(a-1)-1
		ans = min(ans, a + (x-1) // 2)
	else:
		ans = n-a
		x = a + (n-b) + 1
		ans = min(ans, (n-b) + 1 + (n-x) // 2)

print(ans)


### FIXED CODE ###

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

if (b-a) % 2 == 0:
	ans = (b-a) // 2
else:
	if a-1 < n-b:
		ans = b-1
		x = b-(a-1)-1
		ans = min(ans, a + (x-1) // 2)
	else:
		ans = n-a
		x = a + (n-b) + 1
		ans = min(ans, (n-b) + 1 + (n-x) // 2)

print(ans)
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    N, P = iim()
    S = list(map(int, input().rstrip()))

    if P == 2:
        cnt = N * (N + 1) // 2
        for i, si in enumerate(S):
            if si & 1:
                cnt -= i + 1
        print(cnt)
        return

    i = j = 1
    while j < P:
        i += 1
        j *=10
    keta = i - 2
    cnt = 0
    for i in range(N):
        ans = 0
        if S[i] == 0:
            cnt += 1
        for j in range(i, i+keta):
            ans = 10*ans + S[j]
        for j in range(i+keta, N):
            sj = S[j]
            ans = 10*ans + sj
            #print(ans, ans % P)
            if ans % P == 0:
                cnt += 1
    print(cnt)

if __name__ == "__main__":
    resolve()


### FIXED CODE ###

#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    N, P = iim()
    S = list(map(int, input().rstrip()))

    if P == 2 or P == 5:
        cnt = 0
        for i, si in enumerate(S):
            if si % P == 0:
                cnt += i + 1
        print(cnt)
        return

    T = [0] * P
    T[0] = 1

    ss, p10 = 0, 1
    for s1 in S[::-1]:
        ss += p10 * s1
        ss %= P
        T[ss] += 1
        p10 = 10 * p10 % P

    ans = 0
    for i in T:
        ans += i*(i-1)//2
    print(ans)

if __name__ == "__main__":
    resolve()
H, W = map(int, input().split())

S = [list(input()) for _ in range(H)]
dydx = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]

def check(h, w):
  count = 0
  for dy, dx in dydx:
    if 0 <= h + dy < H and 0 <= w + dx < W and S[h+dy][w+dx] == '#':
      count += 1
  return count
      
  

for h in range(H):
  for w in range(W):
    if S[h][w] == '.':
      S[h][w] = check(h, w)
  print("".join(S[h])
      
      

### FIXED CODE ###

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

S = [list(input()) for _ in range(H)]
dydx = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]


def check(h, w):
  count = 0
  for dy, dx in dydx:
    if 0 <= h + dy < H and 0 <= w + dx < W and S[h+dy][w+dx] == '#':
      count += 1
  return count

for h in range(H):
  for w in range(W):
    if S[h][w] == '.':
      S[h][w] = str(check(h, w))
  res = "".join(S[h])
  print(res)
import numpy as np

N,K = map(int,input().split())
h = np.array(list(map(int,input().split())))
dp = np.zeros(N,dtype=int)
  
for i in range(N):
  if i <= K:
    dp[i] = abs(h[0]-h[i])
  else:
    cost = min(dp[i-K:i]+abs(h[i]-h[i-K:i]))
    dp[i] = cost
print(dp[N-1])

### FIXED CODE ###

import numpy as np

N,K = map(int,input().split())
h = np.array(list(map(int,input().split())))
dp = np.zeros(N,dtype=int)
  
for i in range(N):
  if i <= K:
    dp[i] = abs(h[0]-h[i])
  else:
    cost = min(dp[i-K:i]+abs(h[i]-h[i-K:i]))
    dp[i] = cost
print(dp[N-1])
# coding: utf-8
# Here your code !
n = int(input())
output = []
for i in range(n):
    order,data =input().split() 
    if order == "insert":
        output.append(int(data))
    elif order == "deleteFirst":
        output.pop()
    elif order == "deleteLast":
        output.popleft()

    elif order == "delete":
        try:
            output.remove(int(data))
        except:
            pass
output.reverse()
print(" ".join(output))
#print(" ".join(map(str,output)))

### FIXED CODE ###

import sys
from collections import deque
n = int(sys.stdin.readline())
lines = sys.stdin.readlines()
 
Q = deque()
for i in range(n):
    command = lines[i].split()
    if command[0] == "insert":
        Q.appendleft(command[1])
    elif command[0] == "deleteFirst":
        Q.popleft()
    elif command[0] == "deleteLast":
        Q.pop()
    elif command[0] == "delete":
        try:
            Q.remove(command[1])
        except:
            pass
print(" ".join(Q))
N,M = input().split()
s,c,a = [],[],[]
number = []
for i in range(int(M)):
    a_i = input().split()
    a.append(a_i)
    s.append(int(a_i[0]))
    c.append(int(a_i[1]))
ans = True
for i in range(int(M)):
    number.append('')
for i in range(int(M)):
    if s[i]==1 and c[i]==0:
        if ans:
            print('-1')
            ans = False
    elif number[s[i]-1] == '' or number[s[i]-1] == c[i]:
        number[s[i]-1] = c[i]
    else:
        if ans:
            print('-1')
            ans = False
for i,elem in enumerate(number):
    if elem == '' and i == 0:
        number[i] = 1
    if elem == '':
        number[i] = 0
if ans:
    strs = '' 
    for i in number:
        strs += str(i)
    print(int(strs))

### FIXED CODE ###

N,M = input().split()
s,c,a = [],[],[]
number = []
for i in range(int(M)):
    a_i = input().split()
    a.append(a_i)
    s.append(int(a_i[0]))
    c.append(int(a_i[1]))
ans = True
for i in range(int(N)):
    number.append('')
for i in range(int(M)):
    if s[i]==1 and c[i]==0 and int(N)>1:
        if ans:
            print('-1')
            ans = False
    elif s[i] > int(N):
        if ans:
            print('-1')
            ans = False
    elif number[s[i]-1] == '' or number[s[i]-1] == c[i]:
        number[s[i]-1] = c[i]
    else:
        if ans:
            print('-1')
            ans = False
for i,elem in enumerate(number):
    if number[i] == '' and i == 0 and int(N) >1:
        number[i] = 1
    elif elem == '':
        number[i] = 0
if ans:
    strs = '' 
    for i in number:
        strs += str(i)
    print(int(strs))
money = int(input())

gohyakuen = money // 500

goen = (money-(gohyaken*500)) // 5

happy = 1000 * gohyakuen + 5 * goen

print(happy)

### FIXED CODE ###

money = int(input())

gohyakuen = money // 500

goen = (money-(gohyakuen*500)) // 5

happy = 1000 * gohyakuen + 5 * goen

print(happy)
a = input()
if a = input():
    print('ARC')
elif a == 'ARC':
    print('ABC')


### FIXED CODE ###

a = input()

if a == 'ABC':
    print('ARC')
elif a == 'ARC':
    print('ABC')
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**12
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

#import sys,resource,bisect
from sys import setrecursionlimit
from resource import getrlimit,setrlimit
from bisect import bisect_left
def setrlim():
  setrecursionlimit(250000)
  soft,hard = getrlimit(resource.RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  setrlimit(resource.RLIMIT_STACK, (128*1024*1024,hard))

def dfs(u,j,dp):
    #ddprint(f"dfs {u=} {j=}")
    ans[u] = j
    for v in dst[u]:
        if ans[v]>=0:
            continue
        x = bisect_left(dp,a[v])
        tmp = dp[x]
        dp[x] = a[v]
        #ddprint(f"dfs {u=} {j=} {x=} {tmp=} av {a[v]} {dp=}")
        dfs(v,j+(1 if tmp==BIG else 0),dp)
        dp[x] = tmp

setrlim()
n = inn()
a = inl()
a[0:0] = [0]
dst = [{} for i in range(n+1)]
for i in range(n-1):
    u,v = inm()
    dst[u][v] = dst[v][u] = 1
ans = [-1]*(n+1)
dp = [BIG]*(n+1)
dp[0] = a[1]
dfs(1,1,dp)
for i in range(1,n+1):
    print(ans[i])


### FIXED CODE ###

#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**12
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

#import sys,resource,bisect
import resource
from sys import setrecursionlimit
from resource import getrlimit,setrlimit
from bisect import bisect_left
def setrlim():
  setrecursionlimit(250000)
  soft,hard = getrlimit(resource.RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  setrlimit(resource.RLIMIT_STACK, (128*1024*1024,hard))

def dfs(u,j,dp):
    #ddprint(f"dfs {u=} {j=}")
    ans[u] = j
    for v in dst[u]:
        if ans[v]>=0:
            continue
        x = bisect_left(dp,a[v])
        tmp = dp[x]
        dp[x] = a[v]
        #ddprint(f"dfs {u=} {j=} {x=} {tmp=} av {a[v]} {dp=}")
        dfs(v,j+(1 if tmp==BIG else 0),dp)
        dp[x] = tmp

setrlim()
n = inn()
a = inl()
a[0:0] = [0]
dst = [{} for i in range(n+1)]
for i in range(n-1):
    u,v = inm()
    dst[u][v] = dst[v][u] = 1
ans = [-1]*(n+1)
dp = [BIG]*(n+1)
dp[0] = a[1]
dfs(1,1,dp)
for i in range(1,n+1):
    print(ans[i])
nb = input().split(' ')

x, y, z = int(nb[0]), int(nb[1]), int(nb[2])
ans = int((x-z)/(y+z))
print(ans)

### FIXED CODE ###

nb = input().split(' ')

a, b = int(nb[0],16), int(nb[1], 16)
if a > b:
    print ('>')
elif a < b:
    print ('<')
else:
    print ('=')
N = input()
count = []
for i in range(N):
    d1,d2,d3 = input().split()
    if (d1==d2)&(d2==d3):
        print('Yes')
        sys.exit()
    else:
        count.append(0)
if sum(count)==0:
    print('No')

### FIXED CODE ###

N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1

    else:
        count=0
if c==1:
    print('Yes')
else:
    print('No')
import copy
import numpy as np
N=int(input())
A=list(map(int,input().split()))
A=np.array(A)

MAX=A[0]
MIN=0
MID=(MAX+MIN+1)//2
#print(MID)
for i in range(100):
    B=copy.deepcopy(A)
    B[0]-=MID
    B[N-1]-=MID
    #print(B)
    for j in range(N):
        B[(j+1)%N]-=B[j]
        B[j]=0
    #print(B)
    if B[0]==0:
        C=copy.deepcopy(A)
        ANS=[0 for i in range(N)]
        C[0]-=MID
        C[N-1]-=MID
        ANS[0]+=MID*2
        #ANS[N-1]+=MID
        for j in range(N):
            C[(j+1)%N]-=C[j]
            ANS[(j+1)%N]+=C[j]*2
            #ANS[j]+=C[j]
            C[j]=0
            #print(C)
            #print(ANS)
        ans=str(ANS[0])
        for i in range(1,len(ANS)):
            ans+=" "+str(ANS[i])
        print(ans)
        exit()
    elif B[0]<0:
        MIN=MID
        if i%2==0:
            MID=(MIN+MAX)//2
        else:
            MID=(MIN+MAX+1)//2
    elif B[0]>0:
        MAX=MID
        if i%2==0:
            MID=(MIN+MAX)//2
        else:
            MID=(MIN+MAX+1)//2
        
    

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=[A[0]]
n=0
for i in range(1,N):
    B.append(A[i]-B[-1])
B.append(A[0]-B[-1])
#print(B)
X=(B[0]-B[-1])//2
Y=[X]
Z=[X*2]
for i in range(N-1):
    Y.append(A[i]-Y[i])
    Z.append(Y[-1]*2)
print(*Z)
def main():
    n = map(int, input().split())
    for i in range(1, 10):
        if 1 <= n//i <= 9 and (n/i).is_integer():
            print('Yes')
        else:
            print('No')
main()

### FIXED CODE ###

import sys

def main():
    n = int(input())
    for i in range(1, 10, 1):
        if 1 <= n//i <= 9 and (n/i).is_integer():
            print('Yes')
            sys.exit()
    print('No')
    
main()
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for i in range(x/c):
    y = x - 50*i
    if y = 0:
        count = count + 1
    else:
        z = y // 2
        count = count + z

print(count)


### FIXED CODE ###

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

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x//500
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        Remains = remains - 100 * j
        for k in range(min(c,Remains//50)+1):
            fifty = Remains - 50 * k
            if fifty == 0:
                count = count + 1
            else: continue

print(count)