peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a,b = map(int,(input().split()))
x = b - a #塔の高さの差分
result  = 0 
for i in range(x+1):
    result += i

print(result - b)
# Judge status: Accepted
#解説参照済み
n=int(input())
a=list(input())
from collections import defaultdict
d=defaultdict(int)
for i in a:
    d[i]+=1
cnt=[]
for i in d.values():
    cnt.append(i+1)
ans=1
mod=10**9+7
for i in cnt:
    ans*=i
    ans%=mod
print(ans-1)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

K = int(input())
cnt = 0
now = 0
if K%2==0:
    print(-1)
    exit()
s = set([0])
for _ in range(10**6+5):
    now += pow(10, cnt, K)*7
    now %= K
    if now in s:
        print(cnt)
        break
    s.add(now)
    cnt += 1
else:
    print(-1)
# Judge status: Accepted
s=input()
n=int(input())
l=""
for i in range(len(s)):
    f=(26+ord("a")-ord(s[i]))%26
    if n>=f:n-=f;l+="a"
    else:l+=s[i]
    if n==0:print(l+s[i+1:]);exit()
print(l[:-1]+chr(ord(l[-1])+n%26))
# Judge status: Wrong Answer
def main():
    a, b = map(int, input().split())
    print(b-a)
    ans = (b-a)//100
    if int(str(a)[-2:]) <= int(str(a)[:1]) and int(str(b)[-2:]) <= int(str(b)[1:]):
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N=int(input())
a=list(map(int, input().split()))
a.sort()
Alice=0
Bob=0
for i in range(N):
  if i%2==0:
    Alice += a[i]
  else:
    Bob += a[i]
print(Alice-Bob)
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(a + b)
# Judge status: Wrong Answer
x,a,b=map(int,input().split())
print(min(abs(a-x),abs(b-x)))
# Judge status: Accepted
import math

N, D = map(int, input().split())
points = []
count =0

for i in range(N):
    X, Y = map(int, input().split())
    if D >= math.sqrt(X ** 2 + Y ** 2):
        count += 1


print(count)
# Judge status: Accepted
def main():
    n = int(input())
    v = list(map(int, input().split()))
    
    if len(v) == 1:
        return
    
    v = sorted(v, reverse=True)
    ans = (v.pop() + v.pop()) / 2
    
    while v != []:
        v = sorted(v, reverse=True)
        ans = (ans + v.pop()) / 2
        
    print(ans)
    
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
c -= b
if c > 0 and c < a:
    print('safe')
elif c <= 0:
    print('delicious')
else:
    print('gangerous')
# Judge status: Accepted
n=int(input())
h=list(map(int,input().split()))
res=[-1]*n
res[0]=0
res[1]=abs(h[0]-h[1])
for i in range(2,n):
  res[i]=min(abs(h[i-1]-h[i])+res[i-1],abs(h[i-2]-h[i])+res[i-2])

print(res[-1])
# Judge status: Accepted
n,m = map(int,input().split())
s = n*(n-1) // 2
t = m*(m-1) // 2
print(s + t)
# Judge status: Accepted
n, k = map(int, input().split())
tree = []
for i in range(n):
    h = int(input())
    tree.append(h)
tree.sort()
ans = 10**9
for i in range(n - k+1):
    t = tree[i+k-1]-tree[i]
    if ans > t:
        ans = t

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

x = 0
for i in range(n):
    x = x ^ a[i]
#print(bin(c))


#x = int(x, 2)
for i in range(n):
    ans = a[i] ^ x
    if i < n - 1:
        print(ans,end=' ')
    else:
        print(ans)
# Judge status: Accepted
x,y=map(int,raw_input().split())
print x+y/2
# Judge status: Wrong Answer
a,b,c = [int(i) for i in input().split()]
if a == b or b == c or a == c:
    print("Yes")
elif a == b+c or b == a+c or c == a+b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
inf = 10**15
mod = 10**9+7
n,m = map(int, input().split())
tmp = n//2
for i in range(m):
    if i % 2 == 0:
        print('{} {}'.format(tmp-i//2, tmp+1+i//2))
    else:
        print('{} {}'.format(1+i//2, n-i//2-1))
# Judge status: Accepted
import itertools
import math
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
distance=[]
f=list(itertools.permutations(list(range(1,n+1))))
for i in range(len(f)):
    length=0
    for j in range(1,n):
        length+=math.sqrt((l[f[i][j]-1][0]-l[f[i][j-1]-1][0])**2+(l[f[i][j]-1][1]-l[f[i][j-1]-1][1])**2)
    distance.append(length)
print(sum(distance)/len(distance))
# Judge status: Accepted
n=int(input())
s=[]
t=[]
for _ in range(n):
    s.append(input())
    
m=int(input())

for _ in range(m):
    t.append(input())
    
point=[None]*100

max_point=0

for i in range(len(s)):
    point_s=s.count(s[i])
    point_t=-1*t.count(s[i])
    point_sum=point_s+point_t
    max_point=max(max_point,point_sum)
    
print(max_point)
# Judge status: Wrong Answer

k=int(input())

if k%2==0:print(int((k/2)**2))
else:print(int((k/2)*(k-1)/2))
# Judge status: Accepted
S=list(input())
k=int(input())
Ans=[0]*len(S)
c=0
for i in range(len(S)):
  if (26-(ord(S[i])-97))%26<=k:
    Ans[i]="a"
    k=k-(26-(ord(S[i])-97))%26
    c=c+(26-(ord(S[i])-97))%26
  else:
    Ans[i]=S[i]
  if i==len(S)-1:
    c=ord(Ans[i])+k%26
    if ord(Ans[i])+k%26>=123:
      c=c-26
    Ans[i]=chr(c)
print("".join(Ans))
# Judge status: Accepted
import math
a, b = list(map(int, input().split()))
n = int(str(a) + str(b))
_n = int(math.sqrt(n))
if _n ** 2 == n:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
# D - Redistribution
S = int(input())
MOD = 10**9+7

# dp[i]: 3 以上の数字で i を作る組み合わせ
dp = [0]*(S+1)

if S <= 2:
    print(0)
elif S <= 5:
    print(1)
else:
    # 初期条件
    dp[3],dp[4],dp[5] = 1,1,1

    # i を作る組合わせ
    for i in range(6,S+1):
        dp[i] = dp[i-2] + dp[i-3] + dp[i-4]

    ans = (dp[S])%MOD
    print(ans)
# Judge status: Wrong Answer
def gcd(a, b):
    if(a == 0):
        return b
    return gcd(b % a, a)
def lcm(a, b):
    return (a * b) / gcd(a, b) 
t = int(input())
ans = 1
while(t != 0):
    t -= 1
    n = int(input())
    if(ans < 10000000000000000000):
        ans = lcm(ans, n)
print(int(ans))
# Judge status: Wrong Answer
N, K = map(int, input().split())
P = list(map(int, input().split()))

def expect(p):
  return (1+p)/2

maxV = sum([expect(p) for p in P[:K]])
for i in range(N-K):
  maxV = max(maxV, maxV - expect(P[i]) + expect(P[i+K]))
print(maxV)
# Judge status: Wrong Answer
s = list(input()) 
s.count(1)
# Judge status: Accepted
import math
print(2*int(input())*math.pi)
# Judge status: Accepted
N=int(input())

ans=0
for i in range(1,N):
  for j in range(1,N):
    if i*j<N:
      ans+=1
    else:
      break
print(ans)
# Judge status: Wrong Answer
n = int(input())
a_inputs = [int(i) for i in input().split()]

a_only = list(set(a_inputs))

ans=0
count=0
for i in range(len(a_inputs)):
    if a_inputs[i]==(count+1):
        count+=1
        continue
    else:
        ans+=1

if a_inputs==a_only:
    print(0)
if 1 not in a_inputs:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
from collections import Counter as co
n=int(input())
s=set(list("qazwsxedcrfvtgbyhnujmiklop"))
l=[500 for i in range(26)]
for i in  range(n):
  gr=sorted([a for a in co(input()).items()])
  vs=set([a for a in zip(*gr)][0])
  for t in s-vs:
    l[ord(t)-97]=0
  if sum(l)==0:print();exit()
  for v, coun in gr:
    fg=ord(v)-97
    l[fg]=min(l[fg],coun)
  s&=vs
ans=""
for i,c in enumerate(l):
  if c:
    f=chr(i+97)
    ans+=f*c
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = [int(input()) for a in range(N)]
maxnum = max(A)
maxcount = A.count(maxnum)
s = sorted(A)
if maxcount == 1:
  index = A.index(maxnum)
  ans = [maxnum] * N
  ans[index] = s[1]
else:
  ans = [maxnum] * N
for a in ans:
  print(a)
# Judge status: Accepted
N = int(input())
words = {}

for _ in range(N):
    s = input()
    if s in words:
        words[s] += 1
    else:
        words[s] = 1

M = int(input())

for _ in range(M):
    t = input()
    if t in words:
        words[t] -= 1

val = sorted(words.values())

if val:
    if val[-1] < 0:
        print(0)
    else:
        print(val[-1])
else:
    print(0)
# Judge status: Accepted
A,B,C=map(int,input().split())
print(max([10*A+B+C,A+10*B+C,A+B+10*C]))
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
k=0
a=[0]*n
for i in range(n):
  a[i]=i+1
  
for i in range(n):
  if a[i]!=p[i]:
    k+=1
    
    
if k<=2:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
n, m = list(map(int, input().split()))
homework = [int(i) for i in input().split()]
for i in homework:
  n -= i
if n >= 0:
  print(n)
else:
  print(-1)
# Judge status: Accepted
a, b = map(int, input().split())
print(b if a >= 13 else 0 if a <= 5 else b//2)
# Judge status: Wrong Answer
a = input().split()
num = 3

if a[0] == a[1]:
    num = num - 1
    if a[0] == a[2]:
        num = num - 1
elif a[1] == a[2]:
    num = num - 1
    
print(num)
# Judge status: Wrong Answer
l = list(input())

for i in range(len(l)):
  if l[i] == "A":
    a = i
    break
for i in range(len(l)):
  if l[-1-i] == "Z":
    b = i
    break
print(b-a+1)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
d=0
e=1
while 1:
  if c+0.5>a:
    a*=e
    e+=1
    d+=b
  else:
    break
print(d)
# Judge status: Accepted
n = input()
last = n[-1]
if last == "2" or last == "4" or last == "5" or last == "7" or last == "9":
    print('hon')
elif last == last == "0" or last == "1" or last == "6" or last == "8":
    print('pon')
else:
    print('bon')
# Judge status: Accepted
S=input()
a=S[0]
z=0
for i in range(len(S)):
    if a==S[i]:
        a=S[i]
    else:
        z=1

if z==0:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
N = input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a == b == c:
  if a % 2 == 0:
    print(-1)
  else:
    print(1)
else:
  ans = 0
  while a % 2 == 0 and b % 2 == 0:
    a1 = a
    b1 = b
    c1 = c
    a = (b1+c1)/2
    b = (a1+c1)/2
    c = (a1+b1)/2
    ans += 1
  print(ans)
# Judge status: Accepted
from collections import defaultdict
n,m=map(int,input().split())
a=list(map(int,input().split()))
d=defaultdict(int)
a.sort()

for i in range(m):
    b,c=map(int,input().split())
    d[c]+=b

d_sorted=sorted(d.items(),reverse=True, key=lambda x:x[0])
l=[]

for i,j in d_sorted:
    for k in range(j):
        l.append(i)
        if len(l)>n:
            break
    else:
        continue
    break
for i in range(min(n, len(l))):
    a[i]=max(a[i],l[i])

print(sum(a))
# Judge status: Accepted
d, n = map(int, input().split())
if d == 0:
    if n == 100:
        print(101)
    else:    
        print(n)
elif d == 1:
    if n == 100:
        print(10100)
    else:
        print(100*n)
elif d == 2:
    if n == 100:
        print(1010000)
    else:
        print(10000*n)
# Judge status: Wrong Answer
import heapq
from fractions import Fraction
import math

def solve():
    N, K = map(int, input().split())
    A = list(map(lambda a: Fraction(-int(a), 1), input().split()))
    heapq.heapify(A)
    for _ in range(K):
        a = heapq.heappop(A)
        heapq.heappush(A, Fraction(a.numerator, a.denominator + 1))

    ans = -heapq.heappop(A)
    print(math.ceil(ans))

solve()
# Judge status: Wrong Answer
x, y = map(int, input().split())
x_, y_ = x, y
ans = 0

def sign(n):
    if n == 0:
        return 0
    else:
        return int(n / abs(n))

if abs(x) > abs(y):
    if x > 0:
        x_ = -x_
        ans += 1
else:
    if x < 0:
        x_ = -x_
        ans += 1
        
ans += abs(abs(x) - abs(y))
x_ += ans

if sign(x_) != sign(y):
    ans += 1
print(ans)
# Judge status: Accepted
K=int(input())
S=input()
length=len(S)
if length <= K:
    print(S)
else:
    print(S[:K]+"...")
# Judge status: Wrong Answer
h, n = map(int, input().split())
a = input()
alst = []
for i in a.split():
    alst.append(int(i))
if sum(alst) > int(h):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a = int(input())
b = int(input())
print(6 - a + b)
# Judge status: Accepted
a=list(map(int,input().split()))
k=int(input())
b=max(a)
for i in range(k):
  b*=2
  
print(sum(a)-max(a)+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 = int(input())
ans = float("inf")
for i in range(1, n):
    a,b = i, n-i
    ans = min(ans, sum(map(int, str(a)))+sum(map(int, str(b))) )
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if A + B <= C:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
A, B, C = list(map(int, input().split()))
K = int(input())

c = 0
while A >= B:
    B *= 2
    c += 1
    # if c >= K:
    #     break
    while B >= C:
        C *= 2
        c += 1
        # if c >= K:
        #     break

print(A)
print(B)
print(C)

if c > K:
    ans = "No"
else:
    ans = "Yes"
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
cleared = [0 for i in range(N)]
wrong = [0 for i in range(N)]
penalty = 0
for i in range(M):
  p, s = map(str, input().split())
  p = int(p) - 1
  if cleared[p] == 1:
    continue
  if s == "AC":
    cleared[p] = 1
    penalty += wrong[p]
  else:
    wrong[p] += 1
print(sum(cleared), penalty)
# Judge status: Wrong Answer
n = int(input())
s = input().split(")(")
l = ""
ans = ""
for i in range(len(s)):
    if len(s) != 1:
        if i % 2 == 0: s[i] += ")"
        else: s[i] = "(" + s[i]
    R = s[i].count(")")
    L = s[i].count("(")
    if R < L: ans += s[i] +  ")" * (L-R)
    elif L < R: 
        ans += s[i]
        l += "(" * (R-L)
    else: ans += s[i]
print(l + ans)
# Judge status: Wrong Answer
n = int(input())
a = sorted([int(each) for each in input().split()])
if len(set(a)) == 1:
    print(0)
else:
    counter = 1
    for i in range(1, n):
        for j in range(i):
            if i == j:
                continue
            if a[i]/a[j] == a[i]//a[j]:
                break
        else:
            # print(i, j)
            counter += 1

    print(counter)
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())
s = [a, b, c, d]
s = sorted(s)
if b >= c:
    print(s[2] - s[1])
else:
    print(0)
# Judge status: Wrong Answer
#!/usr/bin/python

input_data = list(map(int,input().split()))

d1 = input_data[0]
d2 = input_data[1]
d3 = input_data[2]
total = 0

d4 = d2 % d1
if d4 > d3:
    total += 1

print(total)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if (a>10 or b>10 or b<=0 or a<=0) :
    print(-1)
else:
    print(a*b)
# Judge status: Accepted
x = input()
y = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(26):
    if y[i] == x:
        print(y[i + 1])
# Judge status: Wrong Answer
n=12
def doublefactorial(n): 
    if (n == 0 or n == 1): 
        return 1; 
    return n * doublefactorial(n - 2);

def trailing_zeros(longint):
    manipulandum = str(longint)
    return len(manipulandum)-len(manipulandum.rstrip('0'))
  
print("Double factorial is",  
       doublefactorial(n));

print('trailing zeroes are'+ str(trailing_zeros(doublefactorial(n))))
# Judge status: Accepted
x, len_arr = map(int, input().split())

if len_arr == 0:
    print(x)
    exit(0)

arr = set(map(int, input().split()))

for i in range(0, 100):
    if x - i not in arr:
        print(x - i)
        exit(0)
    if x + i not in arr:
        print(x + i)
        exit(0)
# Judge status: Accepted
a,b,c=map(int,open(0));print((a+b)*c//2)
# Judge status: Accepted
X = int(input())
ans = 0
for i in range(1, 33):
    for j in range(2, 11):
        if i**j > X:
            break
        ans = max(ans, i**j)
print(ans)
# Judge status: Wrong Answer
n = int(input())
x = list(map(int,input().split()))
m = []
for i in range(n):
  m.append(x[i])
m.sort()
k = m[n//2-1]
l = m[(n-2)//2-1]
for i in range(n):
  if(x[i]>l):
    print(l)
  else:
    print(k)
# Judge status: Accepted
N = int(input())
A1, A2 = [list(map(int, input().split())) for _ in range(2)]

ans = 0
sum = 0
for n in range(0, N):
    for i in range(0, n + 1):
        sum += A1[i]
    for j in range(n, N):
        sum += A2[j]
    if ans < sum:
        ans = sum
    sum = 0

print(ans)
# Judge status: Wrong Answer

S = input()
S[0:4]=="2017"
print(S)
# Judge status: Accepted
import re
s = input()
if re.match("(dream|dreamer|erase|eraser)+$", s):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N, M = map(int, input().split())
cnt = 0

if N<=M//2:
    cnt = N
    N,M =0,M-2*N
    cnt += M//4
    print(cnt)
else:
    cnt = M//2
    print(cnt)
# Judge status: Accepted
X,A,B = map(int,input().split())

print('delicious'if B <= A else 'safe' if A<B and B-A<=X else 'dangerous')
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
# sv = h[n-1]
ok = True
for i in range(n-1)[::-1]:
    # if h[i] - sv + 1 >= 2:
        # ok = False
    if h[i] <= h[i+1]:
        continue
    elif h[i] == h[i+1] + 1:
        h[i] -= 1
    else:
        ok = False
    # if h[i] - h[i-1] < 0:
        # ok = False
if ok:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
# 入力
N = int(input())

# totalの定義
total = 0

# ループ
while N > 0:
    total += N
    N -= 1
print(total)
# Judge status: Wrong Answer
n = int(input())

s = n//3
t = n % 3

if t == 0:
    print(s**3)
if t == 1:
    print((s+1)*s*s)
if t == 2:
    print((s+1)*(s+1)*s)
# Judge status: Accepted
a,b,c = map(int, input().split())
n = a + b + c
if n <= 21:
  print("win")
else:
  print("bust")
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!
s = input()

word_list = ["dream","dreamer","eraser","erase"]
for i in word_list:
    s = s.replace(i,".")

if len(set(s)) == 1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
def divsor(num):
  count=0
  for i in range(1,num+1):
    if num%i==0:
      count+=1
  return count
 
n=int(input())
 
if(n<=105):
  if(n==105):
    print(1)
  elif(n<105):
    print(0)
    exit()

res=1

for i in range(106,n+1):
  if(divsor(i)==8 and i%2==1):
    res+=1
  print(res)
# Judge status: Accepted
import sys
#sys.exit()
#sorted( ,reverse=True)
X = int(input())
#S,T = map(int, input().split())
#A = list(map(int, input().split()))
#print(N)
#print(S,T)
#print(A)
#print('Yes')
#print('No')

cnt = 0
m = 100 
while m < X:
    m = int(m) * 1.01
    cnt += 1
 
print(cnt)
# Judge status: Accepted
from collections import Counter

N,M = map(int, input().split() )
A   = list(map(int, input().split() ))
B   = [0]*M
C   = [0]*M
Cou = Counter(A)

for i in range(M):
  B[i],C[i]  = map(int, input().split() )
  Cou[C[i]] += B[i]
  
#print(Cou)  
ans=0
cnt=0
S=sorted(Cou,reverse=True)
#print(S)
for num in S:
  kosuu = min(Cou[num],N-cnt)
  cnt += kosuu
  ans += num*kosuu
  
print(ans)
# Judge status: Accepted
k,x = map(int, input().split())
if 500*k >= x:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
import math
A, B=map(int, input().split())

if math.ceil(B/A)==1:
  print(1)

else:
  if (B-A)%(A-1)==0:
    print((B-A)//(A-1)+1)
  
  else:
    print((B-A)//(A-1)+2)
# Judge status: Accepted
N,K,S = map(int, input().split())

if S == 10**9:
  ans = [S]*K +[1]*(N-K)
else:
  ans = [S]*K +[S+1]*(N-K)

ans_txt=''

for s in ans:
  ans_txt += str(s)+' '

print(ans_txt)
# Judge status: Accepted
N=int(input())
a=[int(x) for x in input().split()]
cnt=0
for i in range(N):
  if i%2==0 and a[i]%2==1:
    cnt+=1
print(cnt)
# Judge status: Accepted
import sys
import bisect

inf = 10**15
mod = 10**9+7

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse = True)
    return divisors


n,m = map(int, input().split())
kouho = make_divisors(m)
for num in kouho:
    if m//num >= n:
        print(num)
        sys.exit()
# Judge status: Wrong Answer
import math 
x = int(input())
# x = 10**15
xi = math.floor(x/5.5)
# print(xi)
for i in range(xi,10000000000000000000000000000):
    # print(6*i - math.floor(i/2))
    if(x < 6*i-math.floor(i/2)):
        xa = i
        break

print(xa)
# Judge status: Accepted
#!/usr/bin/env python3
# atcoder 
# Türkçe konuşyorum
# Türkler var mı
# memnün oldum

K = int(input())
S = input()



if(len(S) <= K):
    print(S)
else:
    print(S[:K] + '.' * 3)
    #for i in range(3):
    #    change = change.replace(change[i], '.')
    #print(S[:K] + change[:3])
# Judge status: Accepted
def atc_079a(input_value: str) -> str:
    n = 3
    for i in range(0, len(input_value) + 1 - n):
        for j in range(1, n):
            if input_value[i] != input_value[i + j]:
                break
            if j == n - 1:
                return "Yes"
    return "No"


input_value = input()
print(atc_079a(input_value))
# Judge status: Accepted
S = list(input())
if S[0] == S[1] and S[1] == S[2]:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
def main():
    a,b = map(int, input().split())

    if b<a:
        print(a-1)
    else:
        print(a)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np
N, K = map(int, input().split())
A = np.array([input() for _ in range(N)], dtype=np.int64)
A.sort()

ans = (A[-K:] - A[:K]).min()
print(ans)
# Judge status: Wrong Answer
s = input()
print('2018/'+s[6:11])
# Judge status: Wrong Answer
a = int(input())
b = int(input())
mul = int(a*b)
if mul == 2: print(3)
elif mul == 3: print(2)
else: print(6)
# Judge status: Accepted
a, b, c = map(int, input().split())
x = max(a, b, c)
print(9 * x + sum([a, b, c]))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

even = 0
multiple4 = 0
for a in A:
    if a % 4 == 0:
        multiple4 += 1
    elif a % 2 == 0:
        even += 1

N -= ((even//2)*2)+multiple4
if N <= multiple4+1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
d = {
    '25': 'Christmas',
    '24': 'Christmas Eve',
    '23': 'Christmas Eve Eve',
    '22': 'Christmas Eve Eve Eve'
}

print(d[input()])
# Judge status: Wrong Answer
a, b, c = map(int,input().split())
lst = [a,b,c]
if sorted(lst) == lst:
  print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
N = int(input())
P = list(map(int, input().split()))

ans = 0

for i in range(N):
    ans += P[i] != i+1

print('No' if ans > 2 else 'Yes')
# Judge status: Accepted
n,m = map(int,input().split())
l = [list(map(int,input().split())) for i in range(m)]
x,y = [list(i) for i in zip(*l)]
num = [1] * n
red = ['out'] * n
red[0] = 'in'
for i in range(m):
    if red[x[i]-1] == 'in':
        red[y[i]-1] = 'in'
    num[x[i]-1] -= 1
    num[y[i]-1] += 1
    if num[x[i]-1] == 0:
        red[x[i]-1] = 'out'
print(red.count('in'))
# Judge status: Accepted
from math import ceil,floor
N=int(input())
n1=int(N/1.08)
n2=ceil(N/1.08)

if floor(n1*1.08)==N:
 print(n1)
elif floor(n2*1.08)==N:
 print(n2)
else:
 print(":(")
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, X = map(int, input().split())
a = list(map(int, input().split()))
cs = [0] * (N + 1)
for i in range(N): cs[i + 1] = cs[i] + a[i]
res = N + 1
for i in range(N + 1):
  if cs[i] > X:
    res = i
    break
print(res)
# Judge status: Wrong Answer
N,C,K = map(int,input().split())
T = [int(input()) for i in range(N)]
T.sort()
busCount = 0
pCount = 0
time = 0
firstTime = 0
for i in range(N):
    time = T[i]
    if firstTime == 0:
        firstTime = T[i]
        busCount += 1
    pCount += 1
    if pCount == C:
        firstTime = 0
        pCount = 0
        continue
    if time > firstTime + K:
        firstTime = T[i]
        busCount += 1
        pCount = 1
print(busCount)
# Judge status: Accepted
s = input()
t = input()

if s == t[:-1]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

sabun=[B[i]-A[i] for i in range(N)]
sabun.sort()
num=0
for n in sabun:
    if n<0:
        num+=n
    else:
        num+=n//2
print("Yes" if num>=0 else "No")
# Judge status: Wrong Answer
n = int(input())
l = []
for i in range(n):
    w = input()
    l.append(w)
for k in range(n):
    if  l[k-1][-1] != l[k][0]:
        flag =1
        break
    for j in range(i):
        if l[k] == l[j]:
            flag = 1
            break
        
if(flag == 1):
    print('No')
else:
    print('Yes')
# Judge status: Accepted
a, b = map(int, input().split())
if (a*b % 2 == 0):
  print('Even')
else:
  print('Odd')