peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
from collections import defaultdict

s=list(input())
t=list(input())

ds=defaultdict(list)
dt=defaultdict(list)

for i in range(len(s)):
    ds[s[i]].append(i)
    dt[t[i]].append(i)

dsk=list(ds.values())
dtk=list(dt.values())

if dsk==dtk:
    print('Yes')
    exit()
else:
    print('No')
# Judge status: Accepted
N = int(input())
ABlist = [list(map(int, input().split())) for _ in range(N)]
ABlist.sort(key=lambda x: x[1])
time = 0
for a, b in ABlist:
    time += a
    if time > b:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
s,w = map(int,input().split())
if s>w:
  print('safe')
else:
  print('unsafe')
# Judge status: Wrong Answer
s=input()

if(s[0]==s[1]) or(s[1]==s[2])or(s[2]==s[3]):
  print('Bad')
else:
  print('Yes')
# Judge status: Accepted
N=int(input())
ans=float("Inf")
for i in range(N+1):
   k=N-i
   k2=i
   six=0
   nine=0
   while k2>0:
      six+=k2%6
      k2//=6
   while k>0:
      nine+=k%9
      k//=9
   ans=min(ans,six+nine)
print(ans)
# Judge status: Accepted
s=input()
t=s.find('R')
if t==2:
    print(1)
elif t==-1:
    print('0')
elif t==0:
    if s[t]==s[t+1]:
        if s[t+1]==s[t+2]:
            print('3')
        else:
            print('2')
    else:
        print(1)
else:
    if s[t]==s[t+1]:
        print(2)
    else:
        print(1)
# Judge status: Wrong Answer
n=int(input())
ans=1
for i in range(n):
  ans*=(i+1)
  ans%=1000000007
# Judge status: Wrong Answer
n = int(input())

if n == 1:
    print(1)
    exit()
elif n == 2:
    print(2)
    exit()
elif n == 3:
    print(2)
    print(1)
    exit()
elif n == 4:
    print(3)
    print(1)
    exit()

if n % 2 == 0:
    print(n // 2)
    print(1)
    print(n // 2 - 1)
else:
    print(n // 2 + 1)
    print(n - (n // 2 + 1))
# Judge status: Wrong Answer
n = int(input())
array = list(map(int, input().split()))


def cal(value):
    return value / 2


def odd_even_cal(value):
    return value % 2


for i in range(n):
    if 0 not in list(map(odd_even_cal, array)):
        print(i)
        break
    array = list(map(cal, array))

else:
    print(i)
# Judge status: Accepted
N=int(input())
B=list()
B.append(input())
ans='Yes'
for i in range(N-1):
    tmp=input()
    if tmp in B:
        ans='No'
    if tmp[0]!=B[i][-1]:
        ans='No'
    B.append(tmp)
print(ans)
# Judge status: Accepted
s = str(input())

n = len(s)
c = 0

for i in range(n):
    if s[i] == "R":
        j = i
        a = 0
        while s[j] == "R" and j < n-1:
            a += 1
            j += 1
        if j == n-1 and s[j] == "R":
            a += 1
        c = max(a,c)

print(c)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

def main():
    N=int(input())
    H=list(map(int,input().split()))
    s=0
    if N==1:
        print('Yes')
    else:
        for i in range(0,N-1):
            if H[i]>H[i+1]:
                s+=H[i]-H[i+1]
        if s<2:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a = input()
ascii_a = ord(a)
# print(ascii_a)
next_ascii_a = ascii_a +1
chr(next_ascii_a)
# Judge status: Accepted
n=int(input())
s=list(input())

E=s.count('E')
W=s.count('W')

if s[0]=='E':
  ans=E-1
else:
  ans=E
  
ans1=[]
ans1.append(ans)
  
for x in range(1,n):
  if s[x]=='E':
    if s[x-1]=='E':
      ans-=1
      
  else:
    if s[x-1]=='W':
      ans+=1
  ans1.append(ans)
  
print(min(ans1))
# Judge status: Accepted
from itertools import permutations
from math import sqrt

n = int(input())

temp_list = []
for i in range(n):
    temp_list.append([int(s) for s in input().split()])

ans = 0
for count, temp in enumerate(permutations(list(range(n)))):
    for i in range(n - 1):
        a = temp[i + 1]
        b = temp[i]
        ans += sqrt((temp_list[a][0] - temp_list[b][0]) ** 2 + (temp_list[a][1] - temp_list[b][1]) ** 2)

ans /= (count + 1)
print(ans)
# Judge status: Accepted
x = int(input())
q,r = divmod(x, 100)
if r <= q*5:
    print(1)
else:
    print(0)
# Judge status: Accepted
import sys
import numpy as np
a, b, c, d = map(int, sys.stdin.readline().strip().split())

attack_t = np.ceil(c / b)
attack_a = np.ceil(a / d)

if attack_t <= attack_a:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys,math
input = sys.stdin.readline

N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
cnt = 0
num = 0

print(X)

for i in range(1,N):
  for j in range(1,D):
      #num += pow(abs(X[i-1][j-1] - X[i][j]) ,2)
      print(X[i-1][j-1],X[i][j])
  #if int(math.sqrt(num)):
    #print(math.sqrt(num))
    #cnt += 1

#print(cnt)
# Judge status: Accepted
print(chr(ord(input().rstrip())+1))
# Judge status: Wrong Answer
N,K=map(int,input().split())
x=0
while True:
	if N<=K**x:
		print(x)
		break
	x+=1
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(round((a+b+1)/2))
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
if (b-a)%2==0:
    print(abs(a-b)//2)
else:
    print(min(n-b, n-a))
# Judge status: Wrong Answer
n, k, s = map(int, input().split())
els = 10**9+7

for i in range(n):
    if i < k:
        print(s, end=" ")
    else:
        print(els, end=" ")
# Judge status: Wrong Answer
#import numpy as np
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with

#A = int(input())
H1,M1,H2,M2,K= map(int,input().split())
#A = list(map(int,input().split()))
#B = list(map(int,input().split()))
#S= str(input())

H=(H2-H1)*60
m=H-K
print(m)
# Judge status: Accepted
n=int(input())
ans=0
for i in range(n):
    
    m=n//(i+1)
    
    ans += (i+1) *m*(m+1)/2
    
print(int(ans))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
 
money = 1000
stock = 0
 
for i in range(n-1):
  if a[i+1] > a[i]:
    stock = money // a[i]
    money = money - stock*a[i] + stock*a[i+1]
 
print(money)
# Judge status: Wrong Answer
import numpy as np
import math
import collections

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


ans = 0
node_num = 1
pre_node_num = 1
B = [1 - A[0]]
for i in range(1, N):
    tmpB = min(2 * B[i - 1] - A[i], sum(A[i + 1:]))
    # print(tmpB)
    if tmpB < B[i - 1] - A[i]:
        ans = -1
        break
    B.append(tmpB)


if ans != -1:
    ans = sum(A) + sum(B)
print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a==1:a=14
if b==1:b=14
if a<b:
    print("Alice")
elif a==b:
    print("Draw")
else:
    print("Bob")
# Judge status: Wrong Answer
n, k = map(int, input().split(' '))
nums = list(map(int, input().split(' ')))
nums.sort(reverse=True)
if k >= n:
  print(0)
else:
  if k > 0:
    nums = nums[:k]
  print(sum(nums))
# Judge status: Accepted
N = int(input())

ans = ':('
for i in range(N+1):
  if int(i * 1.08) == N:
    ans = i
    break
    
print(ans)
# Judge status: Wrong Answer
x = list(map(int, input().split()))

print(x)
# Judge status: Accepted
n=int(input())
lowx=-(-n*100//108)
highx=-(-(n+1)*100//108)

if lowx<highx:
  print(lowx)
else:
  print(':(')
# Judge status: Wrong Answer
a,b=map(int,input().split())
print ((a*b+1)//2)
# Judge status: Accepted
a,b = map(int, input().split())
ans = abs(abs(a) - abs(b))
sign = inc = 0
if a*b < 0:
    sign = 1
if a-b < 0:
    inc = 1

if a==0 and b==0:
    print(0)
    exit()
elif a==0:
    if inc == 0:
        ans += 1
        print(ans)
        exit()
elif b==0:
    if inc == 0:
        ans += 1
        print(ans)
        exit()

if sign == 0 and inc == 0:
    ans += 2
elif sign == 0 and inc == 1:
    pass
else:
    ans += 1
print(ans)
# Judge status: Accepted
S = list(input())

for i in range(len(S)):
    S[i] = int(S[i])

A = [S[len(S)-1]]
mod = 2019
for i in range(1,len(S)):
    A.append((S[len(S)-i-1]*pow(10,i,mod)+A[i-1]) % mod)

from collections import  Counter

c = Counter(A)

ans = c[0]

for i in range(0,2019):
    if c[i] >= 2:
        ans += (c[i]*(c[i]-1)) //2

print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
abc = a + b + c
if abc > 21:
    print("bust")
else:
    print("win")
# Judge status: Wrong Answer
N,A,B = map(int, input().split())
if (A-B)%2 ==0:
  print(A/B/2)
else:
  print(min(A-1,N-B)+1+(B-A-1)/2)
# Judge status: Accepted
D,T,S=map(int,input().split())
a=D/S
if T>=a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
dic = dict()
lis = list()
for i in range(N):
    tmp = input()
    lis.append(tmp)
    dic[tmp] =0
maxi = 0
for i in lis:
    dic[i] +=1
    if maxi < dic[i]:
        maxi = dic[i]
result = list()
for name in dic:
    if dic[name] == maxi:
        result.append(name)

for i in sorted(result):
    print(i)
# Judge status: Accepted
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    sum = a[0]+a[1]
    ans =sum //2
    if sum%2 ==1:
        ans +=1

    print(ans)
# Judge status: Accepted
n, d = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for x, y in xy:
    distance = (x ** 2 + y ** 2) ** 0.5
    if distance <= d:
        ans += 1

print(ans)
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy

path="U"*y+"R"*x+"D"*y+"L"*(x+1)+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U"
print(path)
# Judge status: Wrong Answer
import math
a,b=map(int,input().strip().split())
print(math.ceil(b/a))
# Judge status: Accepted
def main():
    li = list(map(int, input().split()))
    ans = "Yes" if len(set(li)) == 2 else "No"
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import math
A, B, H, M = map(float, input().split())

kakudo = (30 * H + 0.5 * M)  - 6 * M
if kakudo > 180:
    kakudo -= 180
# print(kakudo)

ans2 = A ** 2 + B ** 2 - 2 * A * B * math.cos(math.pi * (kakudo / 180))
# print(ans2)
print(math.sqrt(ans2))
# Judge status: Accepted
n,m=map(int,input().split())
if (n,m)==(1,1):
  print(1)
elif min(n,m)==1:
  print(max(n,m)-2)
else:
  print((n-2)*(m-2))
# Judge status: Wrong Answer
N=int(input())
S=input()
ANS=""
for i in range(len(S)):
    ANS+=chr(64+((ord(S[i])+N)-64)%26)
print(ANS)
# Judge status: Accepted
N, M = map(int, input().split())
if N > M:
    N, M = M, N
if N == 1 and M == 1:
    print(1)
elif N == 1:
    print(M - 2)
else:
    print(N * M - 2 * N - 2 * M + 4)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))

from itertools import accumulate

tot=sum(l)
ans=2020202020*100000
for i in list(accumulate(l)):
    ans=min(ans, abs(tot-(i*2)))

for i in list(accumulate(l[::-1])):
    ans=min(ans, abs(tot--(i*2)))

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

ans=0
for i in range(n-1):
  if a[i+1]-a[i]==1:
    ans+=c[a[i]-1]
    
print(ans+sum(b))
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,a,b,c,d = list(map(int, input().split()))
a -= 1
b -= 1
c -= 1
d -= 1
s = input()
if "##" in s[a:c+1]:
    ans = "No"
elif "##" in s[b:d+1]:
    ans = "No"
elif c>d and "..." not in s[b-1:d+2]:
    ans = "No"
else:
    ans = "Yes"
print(ans)
# Judge status: Accepted
import sys
import copy
import math
import itertools
import numpy as np
import re

N = int(input())
s = [int(input()) for c in range(N)]
ans = sum(s)
s = [c for c in sorted(list(set(s))) if c%10 != 0]

if ans % 10 ==0:
    if len(s) > 0:
        print(ans-s[0])
        sys.exit(0)
    else:
        print(0)
        sys.exit(0)
else:
    print(ans)
    sys.exit(0)

print(0)
# Judge status: Accepted
N=int(input())
S=input()
A=0 #(
B=0 #)

for s in S:
    if s=='(':
        A+=1
    elif s==')' and A>0:
        A-=1
    else:
        B+=1

print('('*B+S+')'*A)
# Judge status: Accepted
from collections import deque
Q=deque(list(input()))
rev=0

for _ in range(int(input())):
  query=input()
  if query[0]=='1':
    rev^=1
  else:
    q,f,c=query.split()
    if (f=='1')^(rev):
      Q.appendleft(c)
    else:
      Q.append(c)

if rev:
  Q=reversed(Q)
print(''.join(Q))
# Judge status: Accepted
a,b=map(int,input().split())
print(a if b>=a else a-1)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
import math
if math.sqrt(a*b)<c-b-a:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N,K=map(int,input().split())
C=0
for i in range(N):
    a,b=map(int,input().split())
    C+=b
    if C>=K:
        print(a)
        break
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
tmp2 = 0
for i in range(N+1):
  if(i == 0):
    tmp=A.count(1)
    print(str(tmp))
  else:
    tmp2 = i + 1
    tmp=A.count(tmp2)
    print(str(tmp))
# Judge status: Accepted
import numpy as np
n=int(input())
a = list(map(int, input().split()))
m = 1000
kabu = 0
for i in range(n-1):
  if a[i] < a[ i +1 ]:
    kabu =  kabu + int((m - (m % a[i])) / a[i])
    m = m % a[i]
  elif a[i] > a[ i +1 ]:
    m = m + (a[i] * kabu)
    kabu = 0
if kabu > 0:
  m = m + kabu * a[-1]
print(m)
# Judge status: Accepted
N, P = map(int, input().split(' '))
A = tuple(map(int, input().split(' ')))

dp = [[0, 0] for _ in range(N + 1)]
dp[0][0] = 1

for index, a in enumerate(A, start=1):
    if a % 2 == 0:
        dp[index][0] = dp[index - 1][0] * 2
        dp[index][1] = dp[index - 1][1] * 2
    else:
        dp[index][0] = dp[index - 1][1] + dp[index - 1][0]
        dp[index][1] = dp[index - 1][0] + dp[index - 1][1]

print(dp[N][P])
# Judge status: Accepted
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
  print(a - 1, b)
else:
  print(a, b - 1)
# Judge status: Accepted
n=int(input())%10
if n in [ 2, 4, 5, 7,9]:
  print('hon')
elif n in [0,1,6,8]:
  print('pon')
else:
  print('bon')
# Judge status: Accepted
N = int(input())
s = input()

result = 0
for i in range(N - 1):
  a = set(s[:i])
  b = set(s[i:])
  result = max(result, len(a & b))
  
print(result)
# Judge status: Accepted
s=int(input())
mod=10**9+7
dp=[0]*(s+1)
dp[s]=1
for i in range(s,2,-1):
  for j in range(3,s+1):
    if i-j<0:break
    dp[i-j]+=dp[i]
    dp[i-j]%=mod
print(dp[0])
# Judge status: Accepted
W, a, b = map(int, input().split())
if a < a + W <= b:
    ans = b - (a + W)
elif a <= b <= a + W:
    ans = 0
elif a <= b + W <= a + W:
    ans = 0
else:
    ans = a - (b + W)
print(ans)
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))
A = [0]*N
A[0] = B[0]
for i in range(1, N-1):
    A[i] = min(B[i-1], B[i])
A[N-1] = B[N-2]

print(sum(A))
# Judge status: Accepted
n = int(input())
print("ABC" if n<=999 else "ABD")
# Judge status: Wrong Answer
age = int(input())

if age == 7 or age == 5 or age == 3:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import copy
 
inp = input()
friends = input()
friendList = friends.split()
sortedFriends = sorted(friendList, reverse=True)
confs = [sortedFriends[0]]
# copied = copy.deepcopy(sortedFriends)[1:]
sortedFriends.extend(sortedFriends[1:])

sortedFriends = sorted(sortedFriends, reverse=True)
 
#for i in sortedFriends:
    # print(int(i))
confSum = 0
for i in range(int(inp)-1):
    conf = int(sortedFriends[i])
    confSum += conf
print(str(confSum))
# Judge status: Accepted
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
ch=0
for i in range(1,n):
    if a[i]==a[i-1]:
        ch=1
if ch==1:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)
l.append(0)
c = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    z = l[i]-l[j]
    if l[j+1] <= z:
      break
    else:
      a = j+1
      b = n+1
      while a+1 < b:
        m = (a+b)//2
        if l[m] > z:
          a = m
        else:
          b = m
      c += a-j
print(c)
# Judge status: Accepted
N = int(input())
LR = [None] * N
for i in range(N):
    center, length = [int(i) for i in input().split()]
    LR[i] = (center + length, center - length)  # right, left
LR.sort()
now = LR[0][0]
ans = 1
for i in range(1, N):
    right, left = LR[i]
    if now > left:
        continue
    else:
        ans += 1
        now = right
print(ans)
# Judge status: Accepted

n = int(input())

i = int((2*n)**(1/2))

while i*(i+1)<=2*n:
    i+=1

j = (i+1)*i//2-n

for k in range(1,i+1):
    if k!= j:
        print(k)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n <= k:
  print(n*x)
else:
  print(k*x+(n-k)*y)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
ans = A*B*C
if (A*B*C)%2==0:
  print(0)
else:
  cnt = 0
  for i in [A,B,C]:
    if i%2==1 and i>cnt:
      cnt = i
  print(ans//i)
# Judge status: Accepted
N,M=map(int,input().split())
A=list(map(int,input().split()))
ans=N-sum(A)
print(ans if ans>=0 else -1)
# Judge status: Accepted
X = int(input())
ans = 'Yes'

if X < 30:
    ans = 'No'

print(ans)
# Judge status: Accepted
N, A, B = input().split()
N, A, B = int(N), int(A), int(B)

print(N//(A+B)*A + min([A, N%(A+B)]))
# Judge status: Accepted
N = input()
A = [int(x) for x in input().split()]

def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)

def lcm(a, b):
	return a // gcd(a, b) * b

L = 1

for a in A:
	L = lcm(L, a)

print(sum(L // a for a in A) % (10 ** 9 + 7))
# Judge status: Accepted
#!/usr/bin/env python3
import sys

pi = 3.1415
def main():
    R =int(input())
    print(2 * R * pi)
    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(c*10+b+c)
# Judge status: Accepted
a,b=map(int,input().split())
if a>b:print(a-1)
else:print(a)
# Judge status: Wrong Answer
N = int(input())
W = list(map(int, input().split()))
d = sum(W) / 2
count = 0
for i in range(N):
  count += W[i]
  if count >= d:
    if i == 0:
      print(W[0] - sum(W[1:]))
    else:
      print(min(sum(W[i:]) - sum(W[:i]), sum(W[:i + 1]) - sum(W[i+1:])))
# Judge status: Wrong Answer
a, b = map(int, input().split())

cnt = 1
tmp = 0
ans = 0
while True:
    if b == 1:
        print(ans)
        break
    if cnt >= 2:
        tmp += a - 1
    else:
        tmp += a
    cnt += 1
    ans += 1
    if tmp >= b:
        break

print(ans)
# Judge status: Accepted
import bisect,copy,heapq,itertools,math,string
from collections import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, m = MAP()
print(min((2*n+m)//4,m//2))
# Judge status: Accepted
from collections import deque

s = deque(input())
Q = int(input())
    
t = True
    
for i in range(Q):
    query = input().split()
    if query[0] == '1':
        t = not t
    else:
        if(t and query[1] == '1') or (not t and query[1] == '2'):
            s.appendleft(query[2])
        else:
            s.append(query[2])
            
s = ''.join(s)
    
if not t:
    s = s[::-1]
        
print(s)
# Judge status: Accepted
n=int(input())
a=map(int,input().split())
b=map(int,input().split())
c=map(int,input().split())
a=sorted(a)
b=sorted(b)
c=sorted(c)

import bisect

m=0
d=[0 for i in range(n)]
for i in range(n):
    y=bisect.bisect_right(c,b[n-1-i])
    m+=n-y
    d[n-1-i]=m

m=0
for i in a:
    x=bisect.bisect_right(b,i)
    try :
        m+=d[x]
    except IndexError:
        pass
    
print(m)
# Judge status: Accepted
n = int(input())
if n%2 == 1:
  print(0)
  exit()
else:
  cnt = 0
  x=1
  for i in range(1,26):
    x=x*5
    y=2*x
    cnt += n//y
print(cnt)
# Judge status: Accepted
#!/usr/bin/env python3

N, K = map(int, input().split())
num = {}
cnt = 0
for i in range(N):
    a, b = map(int, input().split())
    if a in num: num[a] += b
    else: num[a] = b

for k, v in sorted(num.items()):
    cnt += v
    if K <= cnt:
        print(k)
        exit()
# Judge status: Accepted
n, m, x = map(int, input().split())
C = [list(map(int, input().split())) for _ in range(n)]

import itertools as it
import math

cost = math.inf
for comb in it.chain(*(it.combinations(C, r) for r in range(1, n+1))):
    c, *a = map(sum, zip(*comb))
    if min(a) >= x:
        cost = min(cost, c)

if cost is not math.inf:
    print(cost)
else:
    print(-1)
# Judge status: Wrong Answer
a, b = input().split()
if (int(a) * int(b)) // 2 == 0:
    print('Even')
else:
    print('Odd')
# Judge status: Wrong Answer
S = int(input())
if S<10:
    print(S)
else:
    number=9
    for i in range(1,2**32):
        if number==S:
            print(i-1)
            break
        s=str(i)
        a=0
        for j in range(len(s)-1):
            if abs(int(s[j])-int(s[j+1]))<=1:
                a=1
                break
        if a==1:
            number+=1
# Judge status: Accepted
def solve():
    s = list(input())
    
    a=s.count('a')
    b=s.count('b')
    c=s.count('c')

    if abs(a-b) <= 1 and abs(b-c) <= 1 and abs(c-a) <= 1:
        return 'YES'

    return 'NO'

print(solve())
# Judge status: Wrong Answer
s = input()
s = '2017' + s[4:]
print(s)
# Judge status: Accepted
n,k = map(int, input().split())
x = list(map(int, input().split()))
ans = abs(x[k-1]) + 2*abs(x[0])
for i in range (n-k+1):
  if x[i+k-1] <= 0:
    ans = min(ans, -x[i])
  elif x[i] >= 0:
    ans = min(ans, x[i+k-1])
  else:
    ans = min(ans, -2*x[i] + x[i+k-1], 2*x[i+k-1] - x[i])
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
print((n-3+k)//(k-1))
# Judge status: Accepted
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n, m = inm()
if n == 1 and m == 1:
    print(1)
elif n == 1:
    print(m-2)
elif m == 1:
    print(n-2)
else:
    print((m-2) * (n-2))
# Judge status: Wrong Answer
a,b = map(int, input().split())

if (a*b) / 2  == 0:
  print("Even")
  
else :
  print("Odd")
# Judge status: Accepted
n = int(input())
a_list = list(map(int,input().split()))
cntn = 0
cnt2 = 0
cnt4 = 0
for i in a_list:
    if i%4 == 0:
        cnt4 += 1
    elif i%2 == 0:
        cnt2 += 1
    else:
        cntn += 1
        
flag = True

if cnt4+ 1 >= cntn :
    flag = True

else:
    flag = False

if cnt2 >= 1:
    if cnt4 >= cntn :
        flag = True
    else:
        flag = False

if flag:
    print('Yes')

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

counter = 0
while a%2==b%2==c%2==0:
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    counter += 1
    if counter > 31:
        counter = -1
        break
print(counter)
# Judge status: Accepted
a,b,c=map(int,input().split())
flag=False
for i in range(1,b+1):
  if ( c%b-(a%b)%b )%b == a*i%b:
    flag=True
    break
  
if flag:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
# abc138_a
# a>=3200ならSと出力
# a<3200ならredと出力

a = int(input())

if a >= 3200:
    print('pink')

elif a < 3200:
    print('red')
# Judge status: Accepted
N, K = map(int, input().split())
lst = [int(x) for x in input().split()]
ret = 100 ** 100
for i in range(N - K + 1):
    if lst[i] >= 0 and lst[i + K - 1] >= 0:
        t = lst[i + K - 1]
    elif lst[i] < 0 and lst[i + K - 1] < 0:
        t = abs(lst[i])
    else:
        t = lst[i + K - 1] - lst[i] + min(abs(lst[i]), abs(lst[i + K - 1]))
    ret = min(ret, t)
print(ret)
# Judge status: Wrong Answer
N, K = [int(i) for i in input().split(' ')]
H = list(reversed([int(i) for i in input().split(' ')]))
print(sum(H[K:]))
# Judge status: Accepted
int_a = int(input())

if int_a == 1:
  print(0)
else:
  print(1)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(c // a * b)
# Judge status: Accepted
import sys

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

for k in range(N-M+1):
    for i in range(N-M+1):
        a = [A[j+k][i:i+M] for j in range(M)]
        if a == B:
            print('Yes')
            sys.exit()

print('No')
# Judge status: Accepted
O = input()
E = input()
lo = len(O)
le = len(E)
ans = []
for a, b in zip(O, E[:min(le, lo)]):
    ans.append(a)
    ans.append(b)
if le < lo:
    ans.append(O[-1])

print("".join(ans))