peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a=int(input());input();input();input();e=int(input());
if e - a <= int(input()):
  print('Yay!')
else:
  print(':(')
# Judge status: Accepted
n = input()

n = n.replace("?","D")

d = n.count("D")
pd= n.count("PD")

print( n)
# Judge status: Wrong Answer
K = int(input())

A, B = map(int,input().split())

if (B-A) // K !=0:
    print('OK')
else:
    print('NG')
# Judge status: Accepted
n, blue, red = map(int, input().split())

total= n//(blue+red)*blue

if n%(blue+red)>=blue:
  total+= blue
else:
  total+= n%(blue+red)

print(total)
# Judge status: Accepted
k,a,b=map(int,input().split())
bis=1

if(k<=a-1):
    print(k+1)
elif(b<a+2):
    print(k+1)
else:
    bis+=a-1

    rest=k-(a-1)
#    print(bis,rest)

    exc=rest//2

    bis=(exc*b - (exc-1)*a)

    if(rest%2==1):
        bis+=1

    print(bis)
# Judge status: Accepted
a, b = input().split()
a = int(a + b)
for i in range(100105):
    res = i * i
    if a == res:
        print("Yes")
        break
    if a < res:
        print("No")
        break
# Judge status: Accepted
# coding: utf-8
# Your code here!
x=input().split()



if(x[0]=="0"):
    print(1)
elif(x[1]=="0"):
    print(2)
elif(x[2]=="0"):
    print(3)
elif(x[3]=="0"):
    print(4)
elif(x[4]=="0"):
    print(5)
# Judge status: Accepted
a,b,x = map(int,input().split())

print(b//x-(a-1)//x)
# Judge status: Accepted
a,b = input().split()
L = []
A=  a * int(b)
B = b * int(a)
L.append(A)
L.append(B)
L = sorted(L)
print(L[0])
# Judge status: Accepted
a=list(input())
for i in range(len(a)-1):
	if a[i]==a[i+1]:
		print("Bad")
		break
else:print("Good")
# Judge status: Accepted
N = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    return arr

fact = factorization(N)
s = 0
for p, e in fact:
    s += int(pow(e * 2 + 0.25, 0.5) - 0.5)
print(s)
# Judge status: Accepted
import re
s = input()
print("YES" if re.match("^(dream|dreamer|erase|eraser)+$", s) else "NO")
# Judge status: Accepted
x = int(input())
count = 0
money = 100
while money < x:
    money = int(money * 1.01)
    count += 1
print(count)
# Judge status: Accepted
S = input()
S = S[::-1]
d = 1
mods = [0]
counter = [0]*2019
counter[0] += 1
for s in S:
  s = int(s)
  mods.append((mods[-1]+s*d)%2019)
  counter[mods[-1]] += 1
  d *= 10
  d %= 2019

print(sum([i*(i-1)//2 for i in counter]))
# Judge status: Accepted
def resolve():
    n=int(input())
    a = list(map(int, input().split()))
    are=10**9+7
    s=sum(a)
    ans=0
    for i in range(n):
        s-=a[i]
        ans+=a[i]*s
        ans=ans%are
    print(ans)
resolve()
# Judge status: Accepted
s = input()
print(s[:3]+'8'+s[4:])
# Judge status: Wrong Answer
s = input()
print("Sunny" if s=="Cloudy" else "Rainy" if s=="Sunny" else "Cloudy")
# Judge status: Wrong Answer
n = int(input())
if n == 2:
    print(1)
    exit()
if n == 3:
    print(2)
    exit()
a = n** 0.5
if n%a == 0:
    print(int(2*a)-2)
else:
    while n%a != 0:
        a = a//1-1 
        if n%a == 0:
            print(int(a + n//a-2))
            exit()
# Judge status: Accepted
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

def lcm_list(A):
    l = A[0]
    for a in A[1:]:
        l = lcm(l, a)
    return l

MOD = 10**9 + 7

N = int(input())
*A, = map(int, input().split())
L = lcm_list(A)
ans = 0
for a in A:
    ans += L // a
print(ans % MOD)
# Judge status: Accepted
A, B, K = map(int, input().split())
S = set()
for i in range(K):
    if A+i <= B: S.add(A+i)
    if B-i >= A: S.add(B-i)
for e in sorted(S): print(e)
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))

D={}
for i in A:
    if i in D:
        D[i]+=1
    else:
        D[i]=1
T=0
for i in D:
    T+=D[i]*(D[i]-1)//2

for i in range(n):
    print(T-(D[A[i]]-1))
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))

a.sort()
ans = 0
a.append(-1)
x = []
tmp = 0
for i in range(n):
  if a[i] != a[i+1]:
    tmp += 1
    x.append(tmp)
    tmp = 0
  else:
    tmp += 1
    
x.sort(reverse=True)
print(sum(x[k:]))
# Judge status: Accepted
# solution
import io

data = int(input())
print('Yes' if len([1 for i in range(26) if (data-4*i)%7==0 and data-4*i>=0])>0 else 'No')
# Judge status: Wrong Answer
a, b = map(int, input().split())
cnt = 0
for i in range(a, b + 1):
    if str(i)[0:2] == str(i)[-2:]:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
n, k, q = map(int, input().split())
a = list(input() for _ in range(q))

for i in range(n):
    ans = "Yes" if q - a.count(i+1) < k else "No"
    print(ans)
# Judge status: Accepted
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

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

min = p[0]
count = 0
for i in range(n):
    if p[i] <= min:
        min = p[i]
        count += 1

print(count)
# Judge status: Accepted
# C

N = int(input())
B = [10**10] + list(map(int,input().split())) + [10**10]
ans = 0
for i in range(N):
  ans += min(B[i],B[i+1])
print(ans)
# Judge status: Wrong Answer
N, K, S = map(int,input().split())


output = ""
for i in range(1,N):
    output += str(S)
    output += str(" ")
    if(i > K):
        output += str("0")
        output += str(" ")

print(output[:-1])
# Judge status: Accepted
#create date: 2020-06-28 21:45

import sys
stdin = sys.stdin
import numpy as np

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    d = ni()
    c = np.array(na())
    s = list()
    for i in range(d):
        a = na()
        s.append(a)
    t = [i % 26 + 1 for i in range(d)]
    print(*t, sep="\n")

if __name__ == "__main__":
    main()
# Judge status: Accepted
k,a,b=map(int,input().split())
ans=1
if b-a<=2: #交換するメリットがない k回すべて一枚増やす
    print(ans+k)
else:
    if k<(a+1):
        print(ans+k)
    else:
        zan=(k-(a-1))
        if zan%2==0:
            print(max(ans+k,a+(zan//2)*(b-a)))
        else:
            print(max(ans+k,a+(zan//2)*(b-a)+1))
# Judge status: Accepted
def myAnswer(N:int,M:int) -> int:
   if(N == 1 and M == 1): return 1
   if(min(N,M) == 1): return max(N,M) - 2
   if(min(N,M) == 2): return 0
   return N*M - (max(N,M) * 2 + (min(N,M) - 2) * 2)

def modelAnswer():
   return
def main():
   N,M = map(int,input().split())
   print(myAnswer(N,M))
if __name__ == '__main__':
   main()
# Judge status: Accepted
n = int(input())
l=sorted(list(map(int,input().split())))
an=l[n-1]
x=l[n-2];cr=n-3;cc=0
for i in range(n-3,-1,-1):
  an+=x
  cc+=1
  if cc!=0 and cc%2==0:
    x=l[cr];cr-=1
  #print(an,x,cr)
print(an)
# Judge status: Wrong Answer
#!/usr/bin/env python3
# スペース区切りの整数の入力
A, B = map(int, input().split())
S = input()

index = S.find("-")
if index == -1:
    print("No")
    exit(0)
if len(S[:index]) != A:
    print("No")
    exit(0)
if len(S[index+1:]) != B:
    print("No")
    exit(0)

print("Yes")
# Judge status: Accepted
import math
a, b = map(int, input().split())
print((a+b+1)//2)
# Judge status: Accepted
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    else:
        continue
    break
print(*answer)
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().rstrip().split(" "))
dx = tx - sx
dy = ty-sy
ans = ""
ans += "R"*dx + "U" * dy
ans += "L" * dx + "D" * dy
ans += "D" + "R" * (dx + 1) + "U" * (dy + 1) + "L"
ans += "U" + "L" * (dx + 1) + "D" * (dy + 1) + "R"
print(ans)
# Judge status: Accepted
n = int(input())
for i in range(1,10):
    for j in range(1,10):
        if(n == i*j):
            print('Yes')
            exit()

print('No')
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if (K<N):
    print( (K*X) + ((N-K)*Y) )
else:
    print(N*X)
# Judge status: Accepted
n,m=map(int,input().split())
a,b=min(n,m),max(n,m)
if a==b==1:print(1)
elif a==1:print(b-2)
else:print((a-2)*(b-2))
# Judge status: Accepted
N=int(input())
a=[int(input()) for _ in range(N)]
dp=[0]*(10**5)
dp[0]=1
c=0
ans=0
for i in range(N):
  ans+=1
  if a[c]-1==1:
    print(ans)
    exit()
  if dp[a[c]-1]==1:
    print(-1)
    exit()
  dp[a[c]-1]=1
  c=a[c]-1
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

dp = [0]

for i, x in enumerate(H):
  if i == 0:
    continue
  elif i == 1:
    dp.append( abs(H[i] - H[i-1]) )
  else:
    dp.append( min( dp[i-2] + abs(H[i] - H[i-2]) , dp[i-1] + abs(H[i] - H[i-1]) ) )

print(dp[-1])
# Judge status: Accepted
N = int(input())
if N % 2 == 1:
    odd = 1
else:
    odd = 0
L = [list(map(int, input().split())) for _ in range(N)]

L.sort()
A = [L[i][0] for i in range(N)]
if odd:
    minres = A[(N - 1) // 2]
else:
    minres = A[(N - 2) // 2] + A[N // 2]

L.sort(key=lambda x: x[1])
B = [L[i][1] for i in range(N)]
if odd:
    maxres = B[(N - 1) // 2]
else:
    maxres = B[(N - 2) // 2] + B[N // 2]

print(maxres - minres + 1)
# Judge status: Accepted
x = list(input().split())

for i in range(5):
    if x[i] == "0":
        print(i+1)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

cnt = [0] * ((10**6) + 1)

for elem in a:
    cnt[elem] += 1

unique = []

for i in range((10**6) + 1):
    if cnt[i] == 1:
        unique.append(i)

cnt = [0] * ((10**6) + 1)

a = list(set(a))

for elem in a:
    for m in range(elem * 2, (10 ** 6) + 1, elem):
        cnt[m] = 1

ans = 0

for elem in unique:
    if cnt[elem] == 0:
        ans += 1

print(ans)
# Judge status: Wrong Answer
prog = list(map(int, input().split()))
book = {}
points = [0] * prog[1]
answer = 0

for i in range(prog[0]):
    book[i] = list(map(int, input().split()))

sorted_book = dict(sorted(book.items(), key=lambda x:sum(x[1][1::]), reverse = True))
for j,k in sorted_book.items():
    if sum(points) > prog[1]*prog[2]:
        print(answer)
        break
    answer += k[0]
  
    for l in range(prog[1]):
        points[l] += k[l+1]

if sum(points) < prog[1]*prog[2]:
    print(-1)
# Judge status: Accepted
import math

N = int(input())

low = N // 1.08

while True:
    if math.floor(low * 1.08) == N:
        print(int(low))
        break
    elif math.floor(low * 1.08) > N:
        print(':(')
        break
    low += 1
# Judge status: Accepted
a,b=map(int,input().split())
List = [2,3,4,5,6,7,8,9,10,11,12,13,1]
c = 0
d = 0
for i in range(13):
  if a == List[i]:
    c = i
  if b == List[i]:
    d = i
if c == d:
  print("Draw")
elif c < d:
  print("Bob")
else:
  print("Alice")
# Judge status: Accepted
N, M, K = map(int, input().split())

for n in range(N + 1):
    for m in range(M + 1):
        if n * M + m * N - n * m * 2 == K:
            print('Yes')
            exit()

print('No')
# Judge status: Accepted
n = int(input())
if n % 1000 == 0:
    print(0)
else:
    print(1000-n%1000)
# Judge status: Accepted
import math
def main():
    n = int(input())
    a = list(map(int,input().split()))
    a.sort()
    ans = a[0]
    tmp = 0
    while True:
        for i in range(1,n):

            a[i] %= ans
            if a[i] != 0:
                tmp = min(ans,a[i])
        if sum(a) == ans:
            print(ans)
            return
        a.sort()
        ans = tmp
        a[0] = tmp

if __name__=='__main__':
    main()
# Judge status: Accepted
N = int(input())
X = [list(map(int, input().split())) for _ in range(N)]
S = 0
for i in range(N-1):
  for j in range(i+1, N):
    S += ((X[i][0]-X[j][0])**2+(X[i][1]-X[j][1])**2)**.5
print(S/(N/2))
# Judge status: Accepted
A = list(map(int,input().split()))
A = sorted(A, reverse=True)
print(int("".join(map(str,A[:2]))) + A[-1])
# Judge status: Wrong Answer
N,K= map(int,input().split())
ans1 = N//K
if (N%K == 0):
    ans2 = N//K
else:
    ans2 = N%K
print(abs(ans1-ans2))
# Judge status: Wrong Answer
import sys
s = input()
t = s[::-1]
while len(t) != 0:
    if t[:5] == "maerd" or t[:5] == "esare":
        t = t[5:]
    elif t[:6] == "resare":
        t = t[6:]
    elif t[:7] == "remaerd":
        t = t[6:]
    else:
        print("NO")
        sys.exit()
print("YES")
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int,input().split()))
maxVal = max(a)
minVal = min(a)
a = collections.Counter(a)
ans = 0
for i in range(max(0, minVal-1), maxVal+1):
  temp = a[i - 1] + a[i] + a[i + 1]
  ans = max(ans, temp)
print(ans)
# Judge status: Accepted
A, B, C = [int(i) for i in input().split()]

if A + B >= C:
    print('Yes')
else :
    print('No')
# Judge status: Wrong Answer

def resolve():
    n = int("".join(input().split()))
    print("YES" if n%4==0 else "No")
    


if '__main__' == __name__:
    resolve()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
buka = [0]*n
for i in a:
    buka[i-1] += 1
for i in buka:
    print(i)
# Judge status: Accepted
def YN(P):
    if P:
        print("YES")
    else:
        print("NO")

def yn(P):
    if P:
        print("Yes")
    else:
        print("No")
        
x=int(input())
YN(x==3 or x==5 or x==7)
# Judge status: Accepted
c1 = input()
c2 = input() 
if c1 == c2[::-1]:
 print("YES")
else:
 print("NO")
# Judge status: Accepted
s,t=sorted(list(input())),sorted(list(input()),reverse=True)
print("Yes" if s<t else "No")
# Judge status: Wrong Answer
def Qb():
    a, b, c, k = map(int, input().split())

    if k <= a + b:
        ans = a
    else:
        ans = -1 * (k - (a + b)) + a

    print(ans)


if __name__ == '__main__':
    Qb()
# Judge status: Accepted
from collections import deque
import sys
input = sys.stdin.readline

def main():
    N = int(input())

    q = deque()
    for i in range(1, 10):
        q.append(i)
    now = 0
    for _ in range(N):
        now = q.popleft()
        tmp = now%10
        if tmp != 0:
            q.append(now * 10 + tmp - 1)
        q.append(now * 10 + tmp)
        if tmp != 9:
            q.append(now * 10 + tmp + 1)
    print(now)

if __name__ == "__main__":
    main()
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k+1):
	if i+k<n:
		if a[i]<a[i+k]:
			print('Yes')
		else:
			print('No')
# Judge status: Accepted
s = tuple(map(int, input().rstrip().split('/')))
if s[1] > 4:
    print("TBD")
else:
    print("Heisei")
# Judge status: Accepted
n=int(input())
for a in range(100):
    for b in range(100):
        if a*4+b*7==n:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
K = int(input())
S = input()

answer = None
is_less_than_K = len(S) <= K
if is_less_than_K:
    answer = S
else:
    answer = S[0:K] + '...'

print(answer)
# Judge status: Accepted
h = int(input())

cnt = 0
while h:
    h //= 2
    cnt += 1

print(2**cnt-1)
# Judge status: Accepted
def main():
    n = int(input())
    w = list(map(int, input().split()))

    avr = sum(w) // 2
    res = 0
    ans1 = 0
    ans2 = 0    
    for i in range(n):
        res += w[i]
        if res > avr:
            ans1 = abs(sum(w[(i+1):]) - sum(w[:(i+1)]))
            ans2 = abs(sum(w[i:]) - sum(w[:i]))
            print(min(ans1,ans2))
            return


if __name__ == '__main__':
    main()
# Judge status: Accepted
from math import factorial
def combi(n,k):
    return factorial(n) // factorial(k) // factorial(n-k)

n,p = map(int,input().split())
a = list(map(int,input().split()))
even = 0
odd  = 0
for i in a:
    if i&1:
        odd  += 1
    else:
        even += 1
picke = 0
for i in range(even + 1):
    picke += combi(even,i)
picko = 0
for i in range(p,odd + 1,2):
    picko += combi(odd,i)
print(picke*picko)
# Judge status: Accepted
n=int(input())
s=list(input())
a=0
b=0
c=0
for i in range(n):
    d=s[i]
    if d=='(':
        a+=1
    else:
        b+=1
        if b-c>a:
            c+=1
print('('*c+''.join(s)+')'*(a-b+c))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)

ans = a[0]

nn = (n-2)//2
nnn = (n-2)%2

for i in range(nn):
    ans = ans + a[i+1]*2

if nnn == 1:
    ans = ans + a[i+2]

print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    ans = [[n//2,n//2+1]]
    for _ in range(m-1):
        v = ans[-1]
        new = [v[0]-1,v[1]+1]
        if new[0] == 0:
            new[0] = n
        if new[1] == n+1:
            new[1] = 1
        ans.append(new)
    for a in ans:
        print(*a)
if __name__ == "__main__":
    main()
# Judge status: Accepted
import math

n = int(input())
aL = list(map(int, input().split(" ")))

ans = 0
for index, a in enumerate(aL):
    if (index + 1) % 2 == 1 and a % 2 == 1:
        ans += 1

print(ans)
# Judge status: Accepted
from math import gcd
from functools import reduce

N = int(input())
A = [int(i) for i in input().split()]

def gcd_list(numbers):
    return reduce(gcd, numbers)

g = gcd_list(A)
print(g)
# Judge status: Wrong Answer
def main():
    n, *a = map(int, open(0).read().split())
    if n == 1:
        print(1)
        return

    m = max(a) + 1
    l = [0] * m
    for i in a:
        if l[i] > 1:
            continue
        for j in range(i, m, i):
            l[j] = 2
        l[i] -= 1

    ans = sum(l[i] == 1 for i in a)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

for i in range(len(A)):
  if A[i]%2 == 0 and (A[i]%3!=0 and A[i]%5!=0):
    print("DENIED")
    exit()
print("APPROVED")
# Judge status: Accepted
import sys
sys.setrecursionlimit(300000)
from collections import defaultdict

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')

N = I()
S = [input() for _ in range(N)]
M = I()
T = [input() for _ in range(M)]

d = defaultdict(int)
for s in S:
    d[s] += 1
for t in T:
    d[t] = max(0, d[t] - 1)

print(max(d.values()))
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
x=s.count('RL')
y=0
cnt=0
for i in range(n-1):
  if s[i]==s[i+1]:
    cnt+=1
if s[0]=='L' and s[n-1]=='R':
  y+=1
while k>0:
  if x>0:
    x-=1
    cnt+=2
    k-=1
  else:
    if y>0:
      cnt+=1
      y-=1
      k-=1
    else:
      break
print(min(n-1,cnt))
# Judge status: Accepted


def main():
    N, T = map(int, input().split())
    l = []
    for _ in range(N):
        c, t = map(int, input().split())
        l.append((c, t))
    l.sort()
    for e in l:
        if e[1] <= T:
            print(e[0])
            return
    print("TLE")
        

if __name__ == "__main__":
    main()
# Judge status: Accepted
import heapq
n,m=map(int,input().split())
work=[[] for _ in range(m)]
for _ in range(n):
    a,b=map(int,input().split())
    if a<=m:
        work[a-1].append(b)
ans=0
q=[]
heapq.heapify(q)
for i in range(m):
    for x in work[i]:
        heapq.heappush(q,-x)
    if q!=[]:
        ans+=heapq.heappop(q)*(-1)
print(ans)
# Judge status: Accepted
str_n = str(input())

temp = int(str_n[0])
temp = 111*temp

int_n = int(str_n)

if int_n > temp:
  temp = int(str_n[0])
  temp = temp+1
  print(111*temp)
else:
  temp = int(str_n[0])
  print(111*temp)
# Judge status: Accepted
a=input()
b=input()
if a==b[:-1]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,k = map(int,input().split())

if n%k == 0:
    print(0)
else:
    print(1)
# Judge status: Accepted
N = int(input())
h = list(map(int,input().split()))

ml = [10**9]* N

ml[0] = 0
ml[1] = abs(h[1]-h[0])
for i in range(2,N):
    ml[i] = min(abs(h[i]-h[i-1]) + ml[i-1], abs(h[i]-h[i-2]) + ml[i-2])

print(ml[N-1])
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
c = [0]*(n-1)
s = [0]*(n-1)
f = [0]*(n-1)

for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split())

def dfs(eki,t):
    if eki == n-1:
        return t

    cc = c[eki]
    ss = s[eki]
    ff = f[eki]

    if t <= ss:
        return dfs(eki+1, ss+cc)
    else:
        return dfs(eki+1, -(-t//ff)*ff+cc)

for i in range(n):
    print(dfs(i,0))
# Judge status: Accepted
l,r,d=map(int,input().split())
if l%d!=0:
  print(r//d-l//d)
else:
  print(r//d-l//d+1)
# Judge status: Accepted
import sys

def cirCle(r: int):
 ans = r ** 2
 print(ans)
 return()


if __name__ == '__main__':
  args = input()
  cirCle(int(args))
# Judge status: Accepted
a, b, c = map(int, input().split())
if 1 <= a <= 100 and 1 <= b <= 100 and 1 <= c <= 100:
  if b - a == c - b:
    print('YES')
  elif a - b == b - c:
    print('YES')
  else:
    print('NO')
# Judge status: Wrong Answer
N = int(input())
an = list(map(int, input().split()))
ans = 0
for i in range(min(an)+1, max(an)):
    ans = max(ans, an.count(i) + an.count(i-1) + an.count(i+1))
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[]
for i in range(n):
  a.append(input())
b=[]
for i in range(m):
  b.append(input())

res=0
for i in range(0,n-m+1):
  keep=0
  for j in range(i,i+m):
    if b[j-i] in a[j]:
      keep+=1
  if keep==m:
    print("Yes")
    break
if keep!=m:
  print("No")
# Judge status: Accepted
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,l=INTM()
    s=[]
    for i in range(n):
        s.append(STR())
    s.sort()
    print(*s,sep='')
if __name__ == '__main__':
    do()
# Judge status: Accepted
def main():
  s = input()
  flg=0
  for i in range(0,26):
    if chr(ord('a')+i) not in s:
      print(chr(ord('a')+i))
      flg=1
      break
  if flg ==0:
    print("None")
    
main()
# Judge status: Accepted
N, M = map(int, input().split())
print(abs((N - 2) * (M - 2)))
# Judge status: Accepted
import numpy as np

N,K = map(int, input().split())
h = np.array(list(map(int, input().split())))
dp = np.full(N,10**10)
dp[0] = 0
for i in range(1,N):
    start = max(0,i-K)
    dp[i] = np.min(dp[start:i]+np.abs(h[i]-h[start:i]))
print(int(dp[-1]))
# Judge status: Accepted
import functools
import math

N, X = [int(i) for i in input().split()]
x_list = [int(i) for i in input().split()]

x_list.append(X)
num_list = sorted(x_list)
 
tmp = map(lambda x: abs(x[0] - x[1]),
          zip(num_list[:-1],num_list[1:]))

D = functools.reduce(lambda acc, x: math.gcd(acc, x), tmp, 0)

print(D)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

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

print(lcm(a, b))
# Judge status: Accepted
from collections import Counter

N = int(input())
S = input()
counter = Counter(S)
ans = counter['R'] * counter['G'] * counter['B']
for l in range(1, N):
    for i in range(N):
        if i + 2*l >= N: break
        a, b, c = S[i], S[i + l], S[i + 2*l]
        if a != b and a != c and b != c: ans -= 1
print(ans)
# Judge status: Wrong Answer
N = int(input())

a_list = map(int, input().split())
a_list = sorted(a_list)

print(sum(a_list[N:2 * N]))
# Judge status: Accepted
N = int(input())

X = list(map(int, input().split()))
x = sorted(X)
small = x[(N//2)-1]
big = x[N//2]
for i in X:
    if i <= small:
        print(big)
    else:
        print(small)
# Judge status: Wrong Answer
import collections

N = int(input())
S = input()

m = 0
index = 0
for i in range(1, N):
    a = set(S[:i])
    b = set(S[i:])
    #print(a)
    #print(b)
    d = 0
    for c in a:
        if c in b:
            d += 1
    if d > m:
        m = d
        index = i
print(index - 1)
# Judge status: Accepted
n, m = map(int, input().split())

fact = []
for i in range(1, int(m**0.5)):
    if m%i==0:
        fact.append(i)
        fact.append(m//i)
fact.sort()

ans = 1
for i in fact:
    if n*i<=m: ans = i
print(ans)