peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x, y = map(int, input().split());

MAX = 100000000000000;

# どれが最小かを考える
# そのまま近づける
a = y - x;
if (a < 0):
  a = MAX;
# xを反転させて近づける
b = y + x;
if (b < 0):
  b = MAX;
# yを反転
c = y * (-1) - x;
if (c < 0):
  c = MAX;
# xとyの両方を反転させて近づける
d = y * (-1) + x;
if (d < 0):
  d = MAX;

# 最小を求める
ans = min(a, b + 1, c + 1, d + 2);
print(ans);
# Judge status: Accepted
n = int(input())
s = input()
ans = s.count("R") * s.count("G") * s.count("B")
cnt = 0
for i in range(n):
    i_ = s[i]
    for j in range(i+1, n):
        if s[j] == i_: continue
        k = 2 * j - i
        j_ = s[j]
        if k >= n or s[k] == i_ or s[k] == j_: continue
        cnt += 1
print(ans - cnt)
# Judge status: Accepted
rList = sorted(list(map(int,input().split())))

print(rList[0]+rList[1])
# Judge status: Accepted
N = int(input())
sheet = [[0 for i in range(10)] for i in range(10)]
cnt = 0

for i in range(1, N + 1):
  str_i = str(i)
  sheet[int(str_i[0])][int(str_i[-1])] += 1

res = 0
for i in range(10):
  for j in range(10):
    res += sheet[i][j] * sheet[j][i]

print(res)
# Judge status: Wrong Answer
a,b=map(int,input().split())
a1,b1=(100*a)//8,10*b
#print(a1,b1)
if a1//10==b and (b1*8)//100==a:
    print(min(a1,b1))
elif a1//10==b:
    print(a1)
elif (b1*8)//100==a:
    print(b1)
else:
    print(-1)
#print(max((100*a)//8,10*b))
# Judge status: Accepted
a,b = map(int,input().split())
print(str(a)*b if a <= b else str(b)*a)
# Judge status: Accepted
n,k,s = map(int,input().split())
a=0
b=0

list=[]

for i in range(k):
    list.append(s)

if len(list) < n:
    for i in range(n-len(list)):
        if s == 1:
            list.append(s+1)
        else:
            list.append(s-1)

for i in list:
    print(i,end=" ")
# Judge status: Accepted
import math

def calc_dist(pta, ptb):
    return abs(pta[0] - ptb[0]) + abs(pta[1] - ptb[1])

n, m = map(int, input().split())
stdts = [tuple(map(int, input().split())) for _ in range(n)]
cpts = [tuple(map(int, input().split())) for _ in range(m)]

for stdt in stdts:
    dist_min = math.inf
    for i in range(m):
        dist = calc_dist(stdt, cpts[i])
        if dist < dist_min:
            dist_min = dist
            ans = i + 1
    print(ans)
# Judge status: Accepted
N=int(input())
cnt=[0 for _ in range(N+1)]
for i in range(1,N+1):
    cnt[i]=cnt[i-1]+1
    a=6
    while i-a>=0:
        cnt[i]=min(cnt[i],cnt[i-a]+1)
        a*=6
    a=9
    while i-a>=0:
        cnt[i]=min(cnt[i],cnt[i-a]+1)
        a*=9
print(cnt[N])
# Judge status: Wrong Answer
str = input()
if str.isupper()=="True":
  print("A")
else:
  print("a")
# Judge status: Accepted
N, A, B = map(int, input().split())
M = A + B
S = input()

for s in S:
    if M <= 0:
        print("No")
    elif s == "a":
        print("Yes")
        M -= 1
    elif s == "b":
        if B <= 0:
            print("No")
        else:
            print("Yes")
            M -= 1
            B -= 1
    else:
        print("No")
# Judge status: Accepted
import bisect

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

# ni - nj = ai + aj (i>j)
# ai - ni = - aj - nj

a1 = sorted([a[i] - (i+1) for i in range(n)])
a2 = sorted([- a[i] - (i+1) for i in range(n)])
ans = 0
for i in range(n):
    left = bisect.bisect_left(a2, a1[i])
    right = bisect.bisect_right(a2, a1[i])
    ans += (right - left)
print(ans)
# Judge status: Accepted
N,K = map(int, input().split())

H = []
for i in range(N):
    H.append(int(input()))

H.sort()

ans = float('inf')
for i in range(N):
    if (i+K-1 > N-1):
        break
    ans = min(ans, H[i+K-1] - H[i])

print(ans)
# Judge status: Accepted
from math import sqrt
s = int(input())
a = 10 ** 9
b = s // a
c = s % a
if c != 0:
    b += 1
    c = a - c
print(0, 0, a, 1, c, b)
# Judge status: Wrong Answer
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int,input().split()))
ans = 0
temp = 10 ** 6
for i in range(N):
    t = T - H_list[i] * 0.006
    if (A - t) < temp:
        ans = i + 1
        temp = A - t
print(ans)
# Judge status: Accepted
import math
A, B, N = (int(i) for i in input().split())  

def func(A, B, x):
  return math.floor(A * x / B) - A * math.floor(x/B)

print(func(A, B, min(N, B-1)))
# Judge status: Accepted
k,s = map(int,input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        if 0 <= s - x - y <= k:
            ans += 1
print(ans)
# Judge status: Accepted
x = input()
count = list(x).count('1')
print(count)
# Judge status: Wrong Answer
lis = list(map(int, input().split()))
unique_list = []
for i in range(len(lis)):
    if lis[i] in unique_list or lis[i] in lis[:i] + lis[i+1:] :
        continue
    unique_list.append(lis[i])
print(len(unique_list))
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))

ML = 50
r = min(ML,k)

for l in range(r):
    imos = [0]*(n+1)
    for i in range(n):
        left = max(0,i-a[i])
        right = min(n,i+a[i]+1)
        
        imos[left] += 1
        imos[right] -= 1
        
    c = 0
    for i in range(n):
        c += imos[i]
        a[i] = c
        
print(*a)
# Judge status: Accepted
from bisect import bisect_left, bisect_right
n = int(input())
INF = 1010101010
dp = [INF] * n
a = [int(input()) for _ in range(n)]
a.reverse()
for i in a:
    dp[bisect_right(dp, i)] = i
print(bisect_left(dp, INF))
# Judge status: Accepted
A,B,C,K=map(int,input().split())
print(B-A if K%2 else A-B)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

l = []
tmp = []
for i in range(n-1):
    if a[i] < a[i+1] and len(tmp) == 0:
        tmp.append(a[i])
    elif a[i] > a[i+1] and len(tmp) == 1:
        tmp.append(a[i])
        l.append(tmp)
        tmp = []
if a[-2] < a[-1]:
    tmp.append(a[-1])
    l.append(tmp)

res = 1000
for a, b in l:
    res = (res // a) * b + res % a

print(res)
# Judge status: Accepted
n = int(input())
s = input()
w = s.count(".")
b = n-w
ans = min(w,b)
b = 0
for i in range(n):
    if s[i] == ".":
        w -= 1
    else:
        b += 1
    ans = min(ans,w+b)
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
if A >= 13:
    print(B)
elif 6<= A and A <= 12:
    print(B//2)
else:
    print(0)
# Judge status: Accepted
N,x = map(int,input().split())
a=list(map(int,input().split()))

a.sort()

ans=0
for i in range(N):
    if x == 0:
        break
    if x >= a[i]:
        ans+=1
        x-=a[i]
    else:
        x = 0
if x != 0:
    ans -= 1
print(max(0,ans))
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if abs(a - c) <= d or (abs(a - b) <= d and abs(b - c) <= d):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import math
def main():
  n = int(input())
  s = input()
  ans=0
  for i in range(0,n):
    sum=0
    x=s[:i+1]
    y=s[i+1:]
    while len(x)>0:
      if x[0] in y :
        sum+=1
      x=x.replace(x[0],'')
    if sum>ans:
      ans=sum
  print(ans)
main()
# Judge status: Accepted
SA = list(str(input())) 
SB = list(str(input())) 
SC = list(str(input())) 
list=[SA,SB,SC]
a=0
while True:
    if len(list[a])==0:
        break
    b=ord(list[a][0])-97
    list[a].pop(0)
    a=b
print(chr(a+65))
# Judge status: Wrong Answer
N = int(input())
pt, px, py = 0, 0, 0
can = True
for i in range(N):
    t, x, y = map(int, input().split())
    T, X, Y = t - pt, abs(x - px), abs(y - py)
    if T < X + Y or T % 2 != (X + Y) % 2:
        can = False
print('Yes' if can else 'No')
# Judge status: Wrong Answer
a,b,k = map(int,input().split())

num = 0
metric_num = 0

while True:
    num += 1
    if a % num ==0 and b % num ==0:
        metric_num += 1
        if metric_num == k:
            break
print(num)
# Judge status: Wrong Answer
n, k = map(int, input().split())
print(n % k if n != 1 else 0)
# Judge status: Wrong Answer
r, g, b = map(int, input().split())
num = int(r+g+b)

if not num %4 == 0:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
S=str(input())
if S.isupper()==True:
  print("A")
else:
  print("a")
# Judge status: Accepted
N, K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
print(sum(p[:K]))
# Judge status: Accepted
a,b,c = map(int,input().split())

print(min(b//a,c))
# Judge status: Accepted
n = int(input())
INF = float('inf')
L = [1]
for x in (6, 9):
    i = 1
    while x ** (i + 1) < 10 ** 6:
        L.append(x ** i)
        i += 1
L.sort(reverse=True)
dp = [INF] * (n + 1)
dp[0] = 0
for m in L:
    for i in range(n+1):
        if dp[i] != INF:
            if i + m <= n:
                dp[i+m] = min(dp[i] + 1, dp[i+m])
print(dp[-1])
# Judge status: Accepted
def main():
    K = int(input())
    
    a_i = 7
    if a_i % K == 0:
        print(1)
        return

    for i in range(2, 10 ** 6+1):
        a_i = a_i * 10 + 7
        if a_i % K == 0:
            print(i)
            return
        a_i %= K
    print(-1)

main()
# Judge status: Accepted
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, As):
    ans = 0
    i = 1
    for A in As:
        if A == i:
            i += 1
        else:
            ans += 1
    ans = -1 if ans == N else ans
    print(ans)


if __name__ == '__main__':
    # S = input()
    N = int(input())
    # N, M = map(int, input().split())
    As = [int(i) for i in input().split()]
    # Bs = [int(i) for i in input().split()]
    solve(N, As)
# Judge status: Accepted
n, m, x = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(n)]
ans = 9**9
flag = False

for i in range(2**n):
    cost = 0
    a = [0]*m
    for j in range(n):
        if (i >> j) & 1:
            cost += c[j][0]
            for k in range(m):
                a[k] += c[j][k+1]
    if min(a) >= x:
        flag = True
        ans = min(ans, cost)

print(ans if flag else -1)
# Judge status: Accepted
n = int(input())
l = [int(i) for i in input().split()]

l.sort()

ans = 0

for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if l[i] == l[j] or l[j] == l[k]:
                continue
            if l[i]+l[j] > l[k]:
                ans += 1
                
print(ans)
# Judge status: Wrong Answer
w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for _ in range(n)]

xl, xr, yb, yt = 0, w, 0, h

for i in range(n):
    if xya[i][2] == 1:
        xl = xya[i][0]
    elif xya[i][2] == 2:
        xr = xya[i][0]
    elif xya[i][2] == 3:
        yb = xya[i][1]
    else:
        yt = xya[i][1]

if xr - xl <= 0 or yt - yb <= 0:
    print(0)
else:
    print((xr - xl)*(yt - yb))
# Judge status: Wrong Answer
n = int(input())
a_list = list(map(int, input().split()))
tr_list = [i+1 for i in range(n)]
ans_list =[]
for i in range(n):
    ans_list.append(a_list.index(tr_list[i])+1)
print(ans_list)
# Judge status: Wrong Answer
n = int(input())
h = list(map(int, input().split()))
c = []
for i in range(n-2):
  d = abs(h[i]-h[i+1])
  e = abs(h[i]-h[i+2])
  c.append(min(d,e))
  if d>e:
  	i+=1
  else:
    i+=2
print(sum(c))
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())

large = max(H,W)
ans = int((N-1) / large)+1

print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())

if a==b and a==c and a%2==0:
  print(-1)

else:
  cnt=0
  while a%2==0 and b%2==0 and c%2==0:
    cnt+=1
    i=a
    j=b
    a=(b+c)//2
    b=(i+c)//2
    c=(i+j)//2
  print(cnt)
# Judge status: Wrong Answer
n,k=map(int,input().split())
s=input()

happy=0
unhappy=0
for i in range(1,n):
  if s[i]==s[i-1]:
    happy+=1
  else:
    unhappy+=1

for i in range(k):
  if unhappy==1:
    unhappy-=1
    happy+=1
    break
  unhappy-=2
  happy+=2

print(happy)
# Judge status: Accepted
A,B = map (int,input().split())
eight = [0] * 2000
ten = [0] * 2000
for i in range(2000):
    eight[i] =(float(i+1) * 0.08)//1
    ten[i] = (float(i+1) * 0.1)//1
ans = 0
for i in range(2000):
    if A == eight[i] and B == ten[i]:
        ans =  i + 1
        break
if ans == 0:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
s = input()
c = 0
for i in s:
  if i == '1':
    c += 1
print(c)
# Judge status: Accepted
N, M = map(int,input().split())
Sab = [list(map(int,input().split())) for i in range(N)]
Cab = [list(map(int,input().split())) for i in range(M)]

for i in range(N) :
    ansC = M+1
    anslen = 10**10
    for j in range(M) :
        Manh = abs(Sab[i][0] - Cab[j][0]) + abs(Sab[i][1] - Cab[j][1])
        if Manh < anslen :
            ansC = j+1
            anslen = Manh
    print(ansC)
# Judge status: Accepted
N = int(input())

if N == 0:
    print(0)
else:
    ret = ""
    while N != 0:
        if N % 2 != 0:
            N -= 1
            ret = "1" + ret
        else:
            ret = "0" + ret
        N //= -2
    print(ret)
# Judge status: Accepted
from math import gcd
if __name__ == "__main__":
    n = int(input())

    ans = 0
    for i in range(1, n+1):
        for j in range(1, n+1):
            for k in range(1, n+1):
                tmp = gcd(i, j)
                tmp = gcd(tmp, k)
                ans += tmp

    print(ans)
# Judge status: Accepted
A,B=map(int,input().split())
if B==100:
  C=100**A*(B+1)
else:
  C=100**A*B
print(C)
# Judge status: Accepted
n=int(input())
f=0
for i in range(15):
    for j in range(26):
        if n==7*i+j*4:
            f=1
print('Yes'if f else 'No')
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

ans = set()
for i in range(1, n-1):
	a = []
	a.append(p[i-1])
	a.append(p[i])
	a.append(p[i+1])
	a.sort()
	if a[0] < a[1] and a[1] < a[2]:
	  ans.add(a[1])
	elif a[0] == a[1]:
	 	ans.add(a[2])
	elif a[1] == a[2]:
		ans.add(a[1])
	
print(len(ans))
# Judge status: Accepted
N, M = map(int, input().split())
if N == 1 and M == 1:
  print(1)
  exit()
if N>=2 and M>=2:
  print((N-2)*(M-2))
else:
  if N == 1:
    print(M-2)
  else:
    print(N-2)
# Judge status: Accepted
n= int(input())

if n<=999:
  print("ABC")
else:
  print("ABD")
# Judge status: Accepted
N, K = map(int, input().split())
print(min(N%K, abs(N%K-K)))
# Judge status: Accepted
def f(A):
    dct = {}
    B = []
    i = 0
    for a in A:
        try:
            B.append(dct[a])
        except:
            dct[a] = i
            B.append(dct[a])
            i += 1
    return B


S = f(list(input()))
T = f(list(input()))
if S == T:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
W, H, x, y = map(int, input().split())
if W//2 == x and H//2 == y:
    flag = 1
else:
    flag = 0
print (W*H/2, flag)
# Judge status: Accepted
n = input()
print("Yes" if len(set(n)) == 3 else "No")
# Judge status: Wrong Answer
l = list(map(int,input().split()))

l.sort()

print(l[0]*l[1]/2)
# Judge status: Wrong Answer
import bisect
N = int(input())
L = list(map(int,input().split()))
L.sort()

ans = 0
for a in range(N):
    for b in range(a+1,N):
        right = bisect.bisect_left(L, L[a]+L[b])
        left = bisect.bisect_left(L, L[b]+1)
        ans += max((right - left, 0))

print(ans)
# Judge status: Wrong Answer
import numpy as np
N,K = map(int,input().split())
an = list(map(int,input().split()))

min_an_index = np.argmin(an)

a = min_an_index
b = N - min_an_index - 1

if K >= a:
    b -= K - a - 1
    if b < 0:
        b = 1
if K >= b:
    a -= K - b - 1
    if a < 0:
        a = 1
        
a1 = a // (K-1)
if a % (K-1) != 0:
    a1 += 1
    
b1 = b // (K-1)
if b % (K-1) != 0:
    b1 += 1

count = a1 + b1
print(count)
# Judge status: Accepted
n,a,b=map(int,input().split())

ans=0
for i in range(1,n+1):
  s=str(i)
  s=sum(list(map(int,s)))
  if a<=s<=b:
    ans+=i
print(ans)
# Judge status: Accepted
n = int(input())
if n<1000:
  print('ABC')
else:
  print('ABD')
# Judge status: Wrong Answer
H, N = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(N)]
T = [(a, b, a / b) for a, b in AB]
T.sort(key=lambda t: t[2], reverse=True)

mp = T[0][1] * (H // T[0][0])
rem = H % T[0][0]
last = min(t[1] for t in T if t[0] >= rem) if rem >= 1 else 0
print(mp + last)
# Judge status: Wrong Answer
K,A,B=map(int,input().split(' '))
if K<A+1:
    print(K)
else:
    print(max(K+1,B+(B-A)*max(0,(K-(A+1))//2)+max(0,(K-(A+1)))%2))
# Judge status: Accepted
N, A, B, C, D = map(int, input().split())
S = input()

if C < D:
    if '##' in S[A-1:C] or '##' in S[B-1:D]:
        print('No')
    else:
        print('Yes')
else:
    if '...' in S[B-2:D+1] and '##' not in S[A-1:C]:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
n,k = map(int,input().split())
cnt = 0
for i in range(k,n+2):
    cnt += n * (n + 1) / 2 - (n - i) * (n - i + 1) / 2 - i * (i - 1) / 2 + 1
print(cnt % (10 ** 9 + 7))
# Judge status: Accepted
x = int(input())
beki_li = []
for i in range(2, 1001):
    for j in range(2, 10):
        if i ** j < 1001 and i**j <= x:
            beki_li.append(i**j)
        else:
            break
beki_li.append(1)
print(max(beki_li))
# Judge status: Wrong Answer
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

N = int(input())
A = lint()
S = set()
pro = 0
for a in A:
    if a//400<8:
        S.add(a//400)
    else:
        pro += 1
print(max(1,len(S)),min(8,len(S)+pro))
# Judge status: Accepted
N,M = map(int,input().split())

ans = [0]*N
ans[0] = 1
ball = [1]*N

for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    if ans[x]:
        ans[y] = 1
    ball[x] -= 1
    ball[y] += 1

    if not ball[x]:
        ans[x] = 0

print(sum([i*(j>0) for i,j in zip(ans,ball)]))
# Judge status: Wrong Answer
inout=input()
if(inout[0]==inout[1]):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
for i in range(1, n):
    a[i] += a[i - 1]
ans = n
for x in a[:n-1]:
    ans = min(ans, abs(a[n-1] - 2 * x))
print(ans)
# Judge status: Wrong Answer
s,t = input().split()
a,b = list(map(int, input().split()))
u = input()

if u == s:
    print(a, b)
else:
    print(a, b-1)
# Judge status: Accepted
#!/usr/bin/env python3
import sys


input = sys.stdin.readline
def IS(cb): return cb(input().strip())
def IL(cb): return [cb(s) for s in input().strip().split()]
def IR(cb, rows): return [IS(cb) for _ in range(rows)]
def ILL(cb, rows): return [IL(cb) for _ in range(rows)]


def solve():
    X, Y = IL(int)
    ans = 1
    while Y // 2 >= X:
        ans += 1
        Y //= 2
    print(ans)

solve()
# Judge status: Accepted
N,K = map(int,input().split())
number = N+1-K+1
W = 0
for i in range(number):
    min = (K+i)*(K+i-1)/2
    max = (K+i)*(2*N-K-i+1)/2
    W += (max-min+1)
w = W % (1000000007)
print(int(w))
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a>b:
  a -1
else:
  a
# Judge status: Accepted
a,b,k = map(int,input().split())

abmin = min(a,b)
nums = []
for i in range(abmin):
    if a % (i + 1) == 0 and b % (i+1) == 0:
        nums.append(i+1)

list.sort(nums,reverse=True)
print(nums[k-1])
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    a,b,c=map(int,input().split())
    if b>=a*c:
        print(c)
    else:
        print(b//a)
    
resolve()
# Judge status: Accepted
A, B, C, K = map(int, input().split())

if K % 2 == 1:
    print(B-A)
elif K % 2 == 0:
    print(A-B)
# Judge status: Accepted
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()
Q = ir()
rev = 0
top = ''
tail = ''
# xor
for _ in range(Q):
    x = sr().split()
    if x[0] == '1':
        rev ^= 1
    else:
        _, f, c = x
        if (int(f)^rev) & 1:
            top += c
        else:
            tail += c

answer = top[::-1] + S + tail
if rev&1:
    answer = answer[::-1]
print(answer)
# 40
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=0
while a>1 or b>1:
  a=a-2
  b=b-2
  c=c+1
print(c)
# Judge status: Wrong Answer
s = input()
d = {}
for letter in s:
  if letter in d:
    d[letter] += 1
  else:
    d[letter] = 1
for i in d.values():
  if i % 2 != 0:
    print("No")
print("Yes")
# Judge status: Accepted
import sys
from math import gcd
input = sys.stdin.readline
N = int(input())
res = 0
a = list(map(int, input().split()))
for x in a: res = gcd(res, x)
print(res)
# Judge status: Accepted
def main():
    N = int(input())
    zorome_count = 0
    for i in range(N):
        d1, d2 = map(int, input().split())
        if d1 == d2:
            zorome_count += 1
        else:
            zorome_count = 0
        
        if zorome_count == 3:
            print('Yes')
            return
    print('No')

if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()
if s[-1] == "s":
  print(s+"es")
else:
  print(s+"s")
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
S =[]
for i in range(N):
    S.append(str(input()))

B =[]
for i in S:
    S1 =list(Counter(i).items())
    #S1 =sorted(S1, reverse = False)
    B.append(S1)

    cnt = 0
for i in range(N-1):
    for j in range(i+1,N):
        if B[i] == B[j]:
            cnt += 1
print(cnt)
# Judge status: Wrong Answer
N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
ans = 10e9
for i in range(N):
    ans = min(ans, abs(X - x[i]))
print(ans)
# Judge status: Accepted
import sys
input=sys.stdin.readline

d=int(input())
C=list(map(int,input().split()))
S=[list(map(int,input().split())) for _ in range(d)]
A=[sorted([[j,S[i][j]] for j in range(26)],key=lambda x:x[1],reverse=True) for i in range(d)]


DP=[0]*26
for i in range(d):
    num,index=0,0
    for j in range(26):
        if A[i][j][1]-(C[j]*(i-DP[j]))>num:
            num=A[i][j][1]-C[j]*(i-DP[j])
            index=j
    DP[index]=i
    print(index+1)
# Judge status: Wrong Answer
N = int(input())
H = list(map(int,input().split()))
if N>1:
    for i in range(N-1,0,-1):
        if H[i] < H[i-1] :
            H[i-1] -= 1
if sorted(H) != H:
    print('NO')
else:
    print('YES')
# Judge status: Wrong Answer
L=[0 for _ in range(10**5)]
n,k=map(int,input().split())
for i in range(n):
    a,b=map(int,input().split())
    L[a-1]+=b
tmp=0
for j in range(n):
    tmp+=L[j]
    if tmp>=k:
        print(j+1)
        break
# Judge status: Accepted
N = int(input())
ordA = ord("a")
mozilist = [0] * 26
for k in range(26):
    mozilist[k] = [0]*N
for i in range(N):
    S = input()
    for j in range(len(S)):
        mozilist[ord(S[j]) - ordA][i] += 1
ans = ""
for p in range(26):
    numofthealphabet = min(mozilist[p])
    ans += chr(ordA + p) * numofthealphabet
print(ans)
# Judge status: Accepted
import decimal
A,B = input().split()
A = decimal.Decimal(A)
B = decimal.Decimal(B)
print(int(A*B))
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
a=[]
cnt=0
flag=s[0]
for i in range(1,n):
  if flag==s[i]:cnt+=1
  else:
    flag=s[i]
    a+=[cnt]
    cnt=0
a+=[cnt]
print(min(sum(a)+2*k,n-1))
# Judge status: Accepted
n=int(input())
a=int(input())
if n%500<=a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x = list(map(int, input().split()))
if max(x) == sum(x) - max(x):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
cnt=0
for i in range(n-2):
  if l[i]<l[i+1]<l[i+2]:
    cnt+=1
print(cnt)
# Judge status: Accepted
S = list(input())

ans = True
if ("N" in S) and not("S" in S):
    ans = False
if ("S" in S) and not("N" in S):
    ans = False
if ("W" in S) and not("E" in S):
    ans = False
if ("E" in S) and not("W" in S):
    ans = False

if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s=input()
a=s.find("A")
z=s.rfind("Z")

print(z-a+1)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a==1 and b!=1 :
    print('Alice')
elif a>b:
    print('Alice')
elif a<b:
    print('Bob')
elif a!=1 and b==1:
    print('Bob')
else:
    print('Draw')
# Judge status: Accepted
# coding: utf-8
N, K = map(int, input().split())
# print(N, K)
S = input()
# print(S)
# print(chr(ord(S[K -1]) + 32))
s = ""
for i in range(N):
    if i == K - 1:
        s += chr(ord(S[K -1]) + 32)
    else:
        s += S[i]
print(s)