peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
A,B = list(map(int, input().split()))

x = 0

for i in range(2):
    if A <= B:
        x = x + B
        B -= 1
    else:
        x = x + A
        A -= 1

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

if (n + k - 1) // k == 1:
    print(1)
else:
    res = ((n - k) + (k - 2)) // (k - 1) + 1
    print(res)
# Judge status: Wrong Answer
import collections

mod=998244353
n=int(input())
arr=list(map(int,input().split()))
dic=collections.defaultdict(int)
for d in arr:
  dic[d]+=1
ans=1
for i in range(1,n):
  ans*=pow(dic[i-1],dic[i],mod)
  ans%=mod
print(ans)
# Judge status: Accepted
import sys
import math

input = sys.stdin.readline
N, X = map(int, input().split())
A = list(map(int, input().split()))

gcd = abs(X - A[0])
for a_i in A:
    gcd = math.gcd(gcd, abs(X-a_i))

print(gcd)
# Judge status: Wrong Answer
s=input()

ans=""
for i in range(len(s)):
    if s[i]=="B":
        if len(ans)==0:
            continue
        t=ans[len(ans)-1]
        ans=ans.rstrip(t)
    else:
        ans+=s[i]
print(ans)
# Judge status: Accepted
from itertools import permutations
Minute=[int(input()) for _ in range(5)]

ans_l=set()
for M in permutations(Minute):
    res=0
    ans=0
    for i in range(5):
        res+=M[i]
        if i==4:
            break
        if res%10!=0:
            res=-(-res//10)*10
    ans_l.add(res)

print(min(ans_l))
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(N+1):
    
    if i%3 != 0 and i%5 != 0:
        ans += i
        
print(ans)
# Judge status: Wrong Answer
w,h,x,y = map(int,input().split())
flg = 0
if x * 2 == w :
    flg +=1
if y * 2 == h :
    flg +=1

if x * h == w * y :
    flg += 1


ans = max(w * y, h*x)

if flg == 1:
    print(w*h/2, 0)
elif flg > 1:
    print(w*h/2, 1)
else:
    print(ans, 0)
# Judge status: Accepted
i = input().split(' ')
A = int(i[0])
B = int(i[1])

for x in range(1,10000000):
    B_hat = int(x/10)
    if B_hat>100:
        break
    if int(x*2/25)==A and B_hat==B:
        print(x)
        exit()
print(-1)
# Judge status: Wrong Answer
n = int(input())
s = input()
t = input()

for i in range(n):
    if s[i:] == t[:n-i]:
        print(n*2 - (n-i))
        exit(0)

print(2**n)
# Judge status: Accepted
S=input()
T=input()
if T[:-1]==S[:]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
v = sorted(list(map(int, input().split())))
ans = v[0]
for n in range(1,N):
    ans = (ans + v[n]) / 2
print(ans)
# Judge status: Wrong Answer
antena = [int(input()) for _ in range(5)]

k = int(input())

max_dist = max(antena)
min_dist = min(antena)

l = max_dist - min_dist

if l < k:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
n, m = map(int,input().split())
ball = [1]*n
red_ball = [1] + [0]*(n-1)
for i in range(m):
  a,b = map(int,input().split())
  if red_ball[a-1] == 1:
    if ball[a-1] == 1:
      ball[a-1] -= 1
      ball[b-1] += 1
      red_ball[a-1] = 0
      red_ball[b-1] = 1
    else:
      ball[a-1] -= 1
      ball[b-1] += 1
      red_ball[b-1] = 1
  else:
    ball[a-1] -= 1
    ball[b-1] += 1
print(sum(red_ball))
# Judge status: Accepted
O = list(input())
E = list(input())
L = len(O)+len(E)
a = list()
for i in range(L):
    if i < len(E):
        a.append(O[i])
        a.append(E[i])
        i += 1
if len(O) != len(E):
    a.append(O[-1])
b = "".join(a)
print(b)
# Judge status: Accepted
N=raw_input()
if "7" in N:
    print "Yes"
else:
    print "No"
# Judge status: Accepted
n = int(input())
s = set()

sub = 1
cumsub = 0
while cumsub <= n:
    s.add(sub)

    cumsub += sub
    sub += 1

dif = cumsub - n
if dif > 0:
    s.remove(dif)

for i in s:
    print(i)
# Judge status: Accepted
import math
a, b, h, m = map(int, input().split())
rh = (h * 60 + m) / 720 * 2 * math.pi
rm = m / 60 * 2 * math.pi
if abs(rh - rm) < 180:
    r = abs(rh - rm)
    c = ((a ** 2) + (b ** 2) - (2 * a * b * math.cos(r))) ** 0.5
    print(c)
if abs(rh - rm) > 180:
    r = 360 - abs(rh - rm)
    c = ((a ** 2) + (b ** 2) - (2 * a * b * math.cos(r))) ** 0.5
    print(c)
if abs(rh - rm) == 180:
    print(a + b)
# Judge status: Accepted
import heapq
n,m = map(int, raw_input().split(' '))

xis = map(int, raw_input().split())
xis.sort()
distances = [v- u for u,v in zip(xis,xis[1:])]
distances.sort(key = lambda x:-x)
print sum(distances[n-1:] or [0])
# Judge status: Wrong Answer
N=int(input())
count=0
for i in range(N):
    a,b=map(int,input().split())

    if a==b:
        count+=1
        if count==3:
            print("Yes")
            exit()
        else:
            pass
    if a!=b:
        count==0
# Judge status: Accepted
H, N = map(int, input().split())
ATK, MP = zip(*(tuple(map(int, input().split())) for _ in range(N)))
MAX_ATK = max(ATK)
table = [0] * (H + MAX_ATK)
for damage in range(1, H + 1):
    table[damage] = min(table[damage - ATK[magic]] + MP[magic] for magic in range(N))
print(table[H])
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = {}
for i in range(n):
    ans[a[i]] = i + 1
s = [ans[i+1] for i in range(n)]
print(*s)
# Judge status: Accepted
N = int(input())
S = input()

M = 0
for i in range(1, N):
    #print(S[:i], S[i:])
    temp = len(set(list(S[:i])) & set(list(S[i:])))
    M = max(M, temp)
print(M)
# Judge status: Accepted
N = int(input())
dic = {}

for i in range(N):
    S = input()
    if S not in dic:
        dic[S] = 1
    else:
        dic[S] += 1

sortDic = sorted(dic.items(), key=lambda x:x[1],reverse=True)

list = []
list.append(sortDic[0][0])
j = 0

if len(sortDic) != 1:
    while j < len(sortDic)-1 and sortDic[j][1] == sortDic[j+1][1]:
        list.append(sortDic[j+1][0])
        j += 1

list = sorted(list)

for i in range(len(list)):
    print(list[i])
# Judge status: Accepted
a,b,c=map(int,input().split())
if a+b+c>=22:
  print('bust')
else:
  print('win')
# Judge status: Wrong Answer
s = str(input())
t = str(input())
if set(s) == set(t):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = int(input())
a =[s]
i = 0
while True:
    i += 1
    if a[i-1] % 2 == 0:
        if (a[i-1]//2) in a:
            print(len(a)+1)
            break
        else:
            a.append(a[i-1]//2)
    elif a[i-1] % 2 == 1:
        if (a[i-1]*3+1) in a:
            print(len(a)+1)
            break
        else:
            a.append(a[i-1]*3+1)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


a=I()
b=I()
h=I()
ans=(a+b)*h//2
print(ans)
# Judge status: Accepted
N,Q = map(int,input().split())
S = input()
ac = [0]*(N+1)
for i in range(N):
    ac[i+1] = ac[i] + (1 if S[i:i+2] == "AC" else 0)
for i in range(Q):
    l,r = map(int,input().split())
    print(ac[r-1]-ac[l-1])
# Judge status: Wrong Answer
import collections

N, M = map(int, input().split())

G = [[] for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    G[b-1].append(a-1)
    G[a-1].append(b-1)

queue = collections.deque([0])
visited = [-1]*N
visited[0] = 0
while queue:
    x = queue.popleft()
    for i in G[x]:
        if visited[i] == -1:
            visited[i] = visited[x] + 1
            queue.append(i)
print("Yes")
print(*visited[1:], sep="\n")
# Judge status: Accepted
a=input().split()
(n,m)=map(int,a)
if n%m==0:
    print(n//m)
else:
    print((n+m-(n%m))//m)
# Judge status: Accepted
W,H,N = map(int,input().split())
XYA = [tuple(map(int,input().split())) for i in range(N)]

l,r,d,u = 0,W,0,H
for x,y,a in XYA:
    if a==1:
        l = max(l,x)
    elif a==2:
        r = min(r,x)
    elif a==3:
        d = max(d,y)
    else:
        u = min(u,y)
w = max(0,r-l)
h = max(0,u-d)
print(w*h)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()
n = len(s) + 1

ans = [[0, 0] for _ in range(n)]
# 左に連続する<
for i in range(1, n):
    if s[i-1] == '<':
        ans[i][0] = ans[i-1][0] + 1
# 右に連続する>
for i in range(0, n-1):
    if s[n-2-i] == '>':
        ans[n-2-i][1] = ans[n-1-i][1] + 1
print(sum(max(i) for i in ans))
# Judge status: Accepted
X = int(input())
ans=0
ans+=(X//500)*1000
X%=500
ans+=(X//5)*5
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())

if a + b == c or a + c == b or b + c == a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,K=map(int,input().split())
X=list(map(int,input().split()))

M=float("inf")
for i in range(N-K+1):
    a,b=X[i],X[i+K-1]
    if 0<=a or b<=0:
        M=min(M,max(abs(a),abs(b)))
    else:
        c=min(abs(a),abs(b))
        M=min(M,abs(a)+abs(b)+abs(c))
print(M)
# Judge status: Accepted
n = int(input())
a = int(input())

if (n % 500) <= a:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
div,mod = divmod(n,11)
if mod <= 6:
    print(div * 2 +1)
else:
    print(div*2+2)
# Judge status: Accepted
from math import gcd,sqrt,floor
a,b = map(int,input().split())
c = gcd(a,b)
x = []
for i in range(1,floor(sqrt(c))+1):
    if c % i == 0:
        x.append(i)
        x.append(c//i)
x.sort()
y = []
i = 1
while c > 1 and i < len(x):
    if c % x[i] == 0:
        y.append(x[i])
        c = c // x[i]
    else:
        i += 1
print(len(set(y))+1)
# Judge status: Wrong Answer
K = int(input())
if K % 2 == 0:
  r = K // 2 **2
else:
  r = K // 2 * (K // 2 + 1)
print(int(r))
# Judge status: Accepted
S = list(input())

r_cnt = 0
max_r_cnt = 0

for s in S:
    if s == "R":
        r_cnt += 1

    else:
        r_cnt = 0
    max_r_cnt = max(r_cnt, max_r_cnt)

print(max_r_cnt)
# Judge status: Accepted
from math import gcd
import sys

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

lcm = 1
for a in A:
    gcd_ = gcd(lcm, a//2)
    lcm = lcm * (a // 2 // gcd_)
for a in A:
    if (lcm // (a // 2)) % 2 == 0:
        print(0)
        sys.exit()

print(M // lcm - M // (2 * lcm))
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if abs(c-a)<=d:
    print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

j = sum(b) - sum(a)
c = [0, 0]
for i in range(n):
    if a[i] > b[i]:
        c[0] += a[i] - b[i]
    if a[i] < b[i]:
        c[1] += -(-(b[i]-a[i])//2)

print("Yes" if max(c) <= j else "No")
# Judge status: Accepted
N = int(input())
Array1 = []
Array2 = []

for i in range(N):
    next_x, next_y = map(int, input().split())
    s = next_x + next_y
    t = next_x - next_y
    Array1.append(s)
    Array2.append(t)

print(max(max(Array1)-min(Array1),max(Array2)-min(Array2)))
# Judge status: Wrong Answer
A, B = [int(n) for n in input().split()]
ans = 0
for i in range(2):
  ans += A if A >= B else B
print(ans)
# Judge status: Accepted
from collections import deque
K=int(input())
queue=deque([1,2,3,4,5,6,7,8,9])
for i in range(K):
    k=queue.popleft()
    if k%10!=0:
        queue.append(10*k+(k%10)-1)
    queue.append(10*k+(k%10))
    if k%10!=9:
        queue.append(10*k+(k%10)+1)
print(k)
# Judge status: Accepted
count=0
n=int(input())
for i in range(1,n+1):
    if i%2!=0:
        count+=1
print(count/n)
# Judge status: Accepted
import sys
A, B, C = [int(x) for x in input().split()]
ans = 0
if(A==B==C)and(A%2==0)and(B%2==0)and(C%2==0):
  print(-1)
  sys.exit()
while (A%2==0)and(B%2==0)and(C%2==0):
  a = B/2 + C/2
  b = C/2 + A/2
  c = A/2 + B/2
  A, B, C = a, b, c
  ans += 1
print(ans)
# Judge status: Accepted
N,T=map(int,input().split())
ct=[list(map(int,input().split())) for _ in range(N)]
ans_l=[]
for i in range(N):
    if ct[i][1]<=T:
        ans_l.append([ct[i][0],i+1])
if ans_l==[]:
    print('TLE')
else:
    len_ans_l=len(ans_l)
    ans=float('inf')
    for i in range(len_ans_l):
        if ans_l[i][0]<ans:
            ans=ans_l[i][0]
    print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
for i in range(n-1):
  a[i+1]+=a[i]
m=a[-1]
ans=10**18
for i in range(n):
  ans=min(ans,abs(m-2*a[i]))
print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python3
from math import gcd
# from numba import njit
from functools import reduce
# from collections import Counter
# from itertools import accumulate
# import numpy as np
# from heapq import heappop,heappush
# from bisect import bisect_left

# @njit
def solve(n,x,a):
    delta_a = [a[i] - x for i in range(n)]
    return reduce(gcd,delta_a)



def main():
    # N = int(input())
    N,X = map(int,input().split())
    a = list(map(int,input().split()))
    print(solve(N,X,a))
    return

if __name__ == '__main__':
    main()
# Judge status: Accepted
from operator import mul
from functools import reduce

n,m = map(int,input().split())

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

ans = 0

if n >= 2:
    ans = ans + cmb(n, 2)

if m >= 2:
    ans = ans + cmb(m, 2)
    
print(ans)
# Judge status: Accepted
import bisect
n = int(input())
A = [int(input()) for _ in range(n)]
L = [-1]*n
count = 0
for i in A:
  t = bisect.bisect_left(L, i) - 1
  if L[t] == -1:
    count += 1
  L[t] = i
print(count)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(c + b - a if c + b > a else 0)
# Judge status: Wrong Answer
n = int(input())

last = ""
for i in range(n):
    s = input()
    if i == 0:
        last = s
    last_dummy = ""
    s_dummy = s
    for j in range(len(last)):
        for k in range(len(s)):
            if last[j] == s[k]:
                last_dummy += last[j]
                s.strip(s[k])
                break
    last = last_dummy
ans_list = sorted(last)
ans = ""
for i in ans_list:
    ans += i

print(ans)
# Judge status: Accepted
s = input()
i = 1; a = 1; n = 1
while i < len(s):
    if a == 1 and s[i-1] == s[i]:
        a = 2; i += 2; n += 1
    else:
        if i == len(s)-2 and s[i] == s[i+1]: n -= 1
        a = 1; i += 1; n += 1
print(n)
# Judge status: Accepted
from collections import deque
n = int(input())
a = list(map(int, input().split()))

b = deque()

for i in range(n):
    if i % 2 == n % 2:
        b.append(a[i])
    else:
        b.appendleft(a[i])


print(*list(b))
# Judge status: Wrong Answer
red, blue= input().split()
r, b = [int (x) for x in input().split()]
s = input()
if s == "red":
    r = r - 1
else:
    b = b - 1
print(r, end=" ")
print(b)
# Judge status: Accepted
n = int(input())
abc = []
for _ in range(n):
    t = [ int(x) for x in input().split() ]
    abc.append(t)

dp = [ [0]*3 for _ in range(n+1) ]

for i in range(n):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][j] = max(dp[i+1][j], dp[i][k] + abc[i][j])

print(max(dp[n]))
# Judge status: Accepted
n = int(input())
s = input()
ws = set()
ws.add(s)
last = s[-1]
for _ in range(n-1):
    s = input()
    if s in ws or s[0] != last:
        print('No')
        break
    else:
        ws.add(s)
        last = s[-1]
else:
    print('Yes')
# Judge status: Accepted
a = input()
if a.islower(): print('a')
else: print('A')
# Judge status: Wrong Answer
a = ["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"]
b = input()
c = []
d = len(b)

for i in range(int(d)):
  c.append(b[i])

e = list(set(c))
f = sorted(e)
g = len(f)
h = int(0)

if g != 26:
  for i in range(int(g)):
    if f[i] == a[i]:
      h = h + 1
    else:
      print(a[i])
else:
  print("None")
  
if h == g:
  print(a[h])
# Judge status: Wrong Answer
[a,b,c,d]=list(map(int,input().split()))
ans="No"
chokudai=c//b
if c%b!=0:
    chokudai+=1
aoki=a//d
if a%b!=0:
    aoki+=1
if chokudai>=aoki:
    ans="Yes"
print(ans)
# Judge status: Accepted
from itertools import combinations_with_replacement


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

ans = 0
for A in combinations_with_replacement(range(1, m + 1), n):
    temp = 0
    for a, b, c, d in QUERY:
        a -= 1; b -= 1
        if A[b] - A[a] == c:
            temp += d
    ans = max(ans, temp)

print(ans)
# Judge status: Accepted
N,M = map(int,input().split())
AB = [tuple(map(int,input().split())) for i in range(M)]

s1 = set()
sn = set()
for a,b in AB:
    if a==1:
        s1.add(b)
    if b==N:
        sn.add(a)

print('POSSIBLE' if s1&sn else 'IMPOSSIBLE')
# Judge status: Accepted
n=int(input())
a=sorted(list(map(int,input().split())))[::-1]
ans=0
for i in range(n):
  ans+=a[i*2+1]
print(ans)
# Judge status: Accepted
import sys
from itertools import permutations
times = [int(sys.stdin.readline().rstrip()) for _ in range(5)]
ans = 10**10
for prm in permutations(range(5)):
    res = 0
    for i, p in enumerate(prm):
        res += times[p]
        r = times[p] % 10
        if i < 4:
            if r != 0:
                res += 10 - r
    ans = min(ans, res)
print(ans)
# Judge status: Accepted
_,a,b,*t = [list(map(int,t.split())) for t in open(0)]
n=min(a)+min(b)
for x,y,c in t:
  n=min(n,a[x-1]+b[y-1]-c)
print(n)
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
for i in range(n):
  if l[i]*2 <=sum(l):
    print("No")
    exit()
print("Yes")
# Judge status: Accepted
X,Y,Z = map(int,input().split())
print(1+(X-Y-2*Z)//(Y+Z))
# Judge status: Wrong Answer
X = str(input())
x = X.index('S')
y = X.rindex('T')
A = X[x:y+1]
a = A.count('S')
b = A.count('T')
ans = len(X)-len(A)
ans += abs(a-b)
print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())

from fractions import gcd
m=(c*d)//gcd(c,d)

A=b//c-(a-1)//c # a-bのうち、cの倍数のもの
B=b//d-(a-1)//d # a-bのうち、dの倍数のもの
C=b//m-(a-1)//m # a-bのうち、cとdの最小公倍数の倍数のもの
ans=(b-a+1)-(A+B-C)
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
print("-1" if a>=b>=10 else a*b)
# Judge status: Wrong Answer
S = input()
int_S = int(S)
N = len(S)
cnt = 0
pos_l = 0
pos_r = 0


while (True):
    pos_r +=  + 1
    
    if (pos_r < N):
        tmp = int(S[pos_l: pos_r + 1])
        if (tmp % 2019 == 0):
            cnt += 1
            pos_l = pos_r
    else:
        pos_l += 1
    
    if (pos_l >= N):
        break


print(cnt)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = []
Bs = []
for _ in range(N):
    A, B = mapint()
    As.append(A)
    Bs.append(B)
As.sort()
Bs.sort()

if N%2==1:
    left = As[N//2]
    right = Bs[N//2]
else:
    left = (As[N//2]+As[N//2-1])
    right = (Bs[N//2]+Bs[N//2-1])

print(right-left+1)
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
if s[:a].isdigit() and s[a] =='-' and s[-b:].isdigit():
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s,w=map(int,input().split())

if(s>w):
    print("safe")
else:
    print("unsafe")
    
#a,b,c,d=map(int,input().split())
# Judge status: Accepted
N=int(input())
ans=""
if N==0:
  ans="0"
while N!=0:
  if N%2!=0:
    ans+="1"
  else:
    ans+="0"
  N=-(N//2)
print(ans[::-1])
# Judge status: Accepted
#!/usr/bin/env python3

import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

st = sorted(P)
x = list(itertools.permutations(st, N))
num_p = x.index(P)
num_q = x.index(Q)
print(abs(num_p - num_q))
# Judge status: Accepted
import re
n, a, b, c, d = map(int, input().split())
road = input()
if c < d:
    if re.search('##', road[a:d]) is None:
        print('Yes')
    else:
        print('No')
 
elif c > d:
    if re.search('##', road[a:]) is None and re.search('\.\.\.', road[b-2:d+1]) is not None:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
N, K = map(int,input().split())

if N < abs(N-K):
  print(N)
else:
  if N % K == 0:
    print(0)
  else:
    print(1)
# Judge status: Accepted
s = sorted(input())
t = sorted(input())[::-1]
flag = -1
for i,j in zip(s,t):
    if ord(i) < ord(j):
        flag = 1
        break
    elif ord(i) == ord(j):
            flag = 0
    else:
        flag = -1
        break

if flag ==1:
    print("Yes")
elif flag == -1:
    print("No")
else:
    if len(s) < len(t):
        print("Yes")
    elif len(s) >= len(t):
        print("No")
# Judge status: Wrong Answer

w=input()
lst=[]
flag = 0
for i in w:
    lst.append(i)

for i in range(len(w)):
    if lst[i] == 99:
        continue
    c = 1
    j = i + 1
    while j < len(w):
        if lst[i] == lst[j]:
            lst[j] = 99
            c += 1
        j += 1
    if c % 2 != 0:
        print("NO")
        flag = 1
        break

if flag == 0:
    print("YES")
# Judge status: Accepted
S = input()
flag = False
for L in range(8):
	T = S[:L] + S[len(S)-(7-L):]
	if T == "keyence":
		flag = True
		break
print("YES" if flag else "NO")
# Judge status: Accepted
L = []
for i in range(6):
    L.append(int(input()))
if (L[4] - L[0]) <= L[5] :
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
import sys
n=int(input())
a=input()
a=[int(s)for s in a.split()]
M=1
Q=1
m=sum(a)
if a[0]>=1:
    if a[0]==1 and n==0:
        print(1)
        sys.exit()
    else:    
        print(-1)
        sys.exit()
for i in range(n):
    M=2*M-a[i+1]
    if M<0:
        print(-1)
        sys.exit()
    M1=M+a[i+1]
    m=m-a[i]
    Q=Q+min(M1,m)
print(Q)
# Judge status: Wrong Answer
p,q,r=map(int,input().split())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
if q+r<p+r and q+r<p+q:
    print(q+r)
# Judge status: Wrong Answer
s=input()
s.replace('2017','2018')
print(s)
# Judge status: Accepted
n=int(input())
a=len(str(n))
if a<2:
    print(n)
elif a<3:
    print(9)
elif a<4:
    print(n-90)
elif a<5:
    print(909)
elif a<6:
    print(n-9090)
else:
    print(90909)
# Judge status: Accepted
X = int(input())
List = [0]*(X+1)
List[1] = 1
for i in range(2,X+1):
    v = i**2
    while(v<=X):
        List[v]=1
        v*=i
        
for i in range(1,X+1)[::-1]:
    if List[i]==1:
        print(i)
        break
# Judge status: Accepted
n=int(input())

l=[int(x) for x in input().split()]

m=l.pop(l.index(max(l)))

if m<sum(l):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
a, b, x = map(int, input().split())
if x*2 <= a**2*b:
    ans = math.degrees(math.atan(2*x/a/b**2))
    print(90 - ans)
else:
    ans = math.degrees(math.atan(2*b/a - 2*x/a**3))
    print(ans)
# Judge status: Accepted
X, Y, Z = map(int, input().split())
print(Z, X, Y)
# Judge status: Accepted
import collections
import bisect
n, m = map(int, input().split())#入力
s = [[int(_) for _ in input().split() ] for _ in range(m)]
a = collections.defaultdict(list)#「県」と「市の誕生順」を分けて管理
for x,y in sorted(s):#ソート⇒県の順番に並ぶ
    a[x]+=[y]
for x,y in s:
    z = bisect.bisect(a[x],y)
    #二分検索⇒「県」内の「市の誕生順」のインデックスを返す
    print("%06d%06d"%(x,z))#形式を整えて出力、出力は入力時の順番
# Judge status: Wrong Answer
print('YNeos'['9' not in input()::])
# Judge status: Accepted
s = ''.join(sorted(input()))
t = ''.join(sorted(input(), reverse=True))

list = sorted([s, t])
print('Yes' if (s == list[0] and s != t) else 'No')
# Judge status: Accepted
N = int(input())
S = input()

cnt = 0
ans = 10 ** 10

for i in range(1, N):
    if S[i] == "E":
        cnt += 1

ans = min(ans, cnt)

for i in range(1, N):
    if S[i - 1] == "W":
        cnt += 1
    if S[i] == "E":
        cnt -= 1
    ans = min(ans, cnt)

print(ans)
# Judge status: Accepted
S=input()

ans='None'
i=97
while i<=122:
    if chr(i)not in S:
        ans=chr(i)
        break
    i+=1

print(ans)
# Judge status: Accepted
N = int(input())
a = 0
for i in range(N+1):
    if i % 3 != 0 and i % 5 != 0:
        a += i
print(a)