peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    l = list(map(int, input().split()))
    l.sort(reverse=True)
    if l.pop(0) < sum(l):
        print('Yes')
    else:
        print('No')
        
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()

last = ""
tmp = ""
ans = 0
for s in S:
    tmp += s
    if s == last:
        continue
    # print(tmp)
    last = tmp
    tmp = ""
    ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
d = list(map(int, input().split()))
d.sort()

print(d[n//2] - d[n//2-1])
# Judge status: Accepted
A,B,C,X,Y = map(int,input().split())
if 2*C >= A+B:
  print(X*A+Y*B)
else:
  if X >= Y:
    if A > 2*C:
      print(2*X*C)
    else:
      print(2*Y*C + (X-Y)*A)
  else:
    if B > 2*C:
      print(2*Y*C)
    else:
      print(2*X*C+(Y-X)*B)
# Judge status: Accepted
s = input()

cnt = 0
for i in range(len(s)):
    if i%2 != int(s[i]):
        cnt += 1
print(min(cnt, len(s)-cnt))
# Judge status: Accepted
s= input()
t =  input()
n =  len(s)
n1 = len(t)
ans= 100000
for i in range(n-n1+1):
    count= 0
    for j in range(n1):
        #print(i,j,n,n1)
        if s[i+j]==t[j]:
            continue
        else:
            count+=1
    #print(count)
    ans = min(ans,count)
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=[]

for i in range(n):
    s,p=input().split()
    a.append([s,100-int(p)])
print(a)
city=sorted(a)   
print(city)
for i in city:
    print(a.index(i)+1)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
if ((abs(a - c) <= d) or (abs(a - b) <= d and abs(b - c) <= d)):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
ans=1
for i in range(7):
    if 2**i<=n:
        ans=2**i
print(ans)
# Judge status: Accepted
order = [int(input()) for _ in range(5)]
tmp=0
diff = 10
for i in order:
  if i%10 != 0:
    diff = min(i%10, diff)
    tmp+=((i//10)+1)*10
  else:
    tmp+=i
print(tmp+diff-10)
# Judge status: Accepted
o = input()
e = input()
s = ""
for a in range(max(len(o), len(e))):
    try:
        s += o[a]
    except IndexError:
        pass
    try:
        s += e[a]
    except IndexError:
        pass
print(s)
# Judge status: Wrong Answer
n = int(input())
x = 2
y = 1
if n==1:
    print(2)
elif n==2:
    print(1)
else:
    for i in range(n-1):
        l = x+y
        x = y
        y = l
    print(l)
# Judge status: Wrong Answer
K, X = map(int, input().split())
print('Yes' if 500 * X >= K else 'No')
# Judge status: Wrong Answer
num = int(input())
base = ["a","b","c","d","e","f","g","h","j","k"]

if num == 1:
  print("a")
elif num == 2:
  print("aa")
  print("ab")
elif num == 3:
  print("aaa")
  print("aab")
  print("aba")
  print("abb")
  print("abc")
elif num == 4:
  print("aaaa")
  print("aaab")
  print("aaba")
  print("aabb")
  print("aabc")
  print("abaa")
  print("abab")
  print("abac")
  print("abba")
  print("abbb")
  print("abbc")
  print("abca")
  print("abcb")
  print("abcc")
  print("abcd")
# Judge status: Wrong Answer
n = int(input())
ab = [[0] * 2 for _ in range(n)]
for i in range(n):
    a, b = map(int, input().split())
    ab[i][0], ab[i][1] = a, b
ab = sorted(ab, key=lambda x: x[1])
#print(ab)
time = 0
for task in ab:
    time += task[0]
    if time <= task[1]:
        print(time, task[1])
        continue
    else:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
import sys
input = sys.stdin.readline

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

dp = [float('inf')] * (n + 1)

dp[1] = 0
dp[2] = abs(h[1] - h[0])

for i in range(3, n + 1):
    dp[i] = min(dp[i - 1] + abs(h[i - 1] - h[i - 2]), dp[i - 2] + abs(h[i - 1] - h[i - 3]))

print(dp[-1])
# Judge status: Wrong Answer
n = int(input())
li = list(map(int,input().split()))
s = sum(li)
sum_li = []
for i,l in enumerate(li):
    if i == 0:
        sum_li.append(l)
        continue
    sum_li.append(sum_li[-1]+l)
all_li = []
for ss in sum_li:
    #print(s,ss)
    all_li.append(abs(s-ss))
print(min(all_li))
# Judge status: Accepted
N,D=map(int,input().split())
ans=0
for i in range(N):
    x,y=map(int,input().split())
    if x**2+y**2<=D**2:
        ans+=1
print(ans)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n):
    for j in range(n):
        for k in range(n):
            if l[i]<l[j]<l[k] and l[i]+l[j]>l[k]:
                ans+=1
print(ans)
# Judge status: Accepted
lwrd = list()
lcnt = list()

N = int(input())
for i in range(N):
    w = input()
    if w in lwrd:
        lcnt[lwrd.index(w)] += 1
    else:
        lwrd.append(w)
        lcnt.append(1)

M = int(input())
for i in range(M):
    w = input()
    if w in lwrd:
        lcnt[lwrd.index(w)] -= 1
    else:
        lwrd.append(w)
        lcnt.append(-1)

if max(lcnt) >= 0:
    print(max(lcnt))
else:
    print(0)
# Judge status: Accepted
# -*- coding: utf-8 -*-

# ケアレスミスしないように一旦紙に式を書くこと

n = int(input())
k = int(input())
x = int(input())
y = int(input())

diff = y - x

p_x = x * n
p_y = diff * (n - k) if (n - k) > 0 else 0

print(p_x + p_y)

#p_x = x * k if n - k >= 0 else x * n
#p_y = (n - k) * y if n - k > 0 else 0

#print(p_x + p_y)
# Judge status: Wrong Answer
a,b,k=map(int,input().split())
if a==0 and b>=k:
    print(0,b-k)
elif a>=k and b==0:
    print(a-k,b)
else:
    print(0,0)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))

def rewrite(n,l):
    cost=0
    for i in l:
        cost += (i-n)**2
    return cost

r1=rewrite(int(sum(a)/len(a)),a)
r2=rewrite(int(sum(a)/len(a))+1,a)

print(r1 if r1<r2 else r2)
# Judge status: Accepted
from string import *
N = int(input())
S = input()
ans = ""

for i in range(len(S)):
    n = ascii_uppercase.find(S[i])
    if(n+N-1 >= 25):
        ans += ascii_uppercase[n+N-26]
    else:
        ans += ascii_uppercase[n+N]
    
print(ans)
# Judge status: Accepted
mod = 2019
l, r = map(int, input().split())

if r//mod - l//mod > 0:
  print(0)
else:
  l %= mod
  r %= mod
  ans = mod - 1
  for i in range(l+1, r+1):
    for j in range(l, i):
      ans = min(i*j%mod, ans)
  print(ans)
# Judge status: Wrong Answer
a = int(input())
b=a+a^2+a^3
print(b)
# Judge status: Accepted
a, b, c, k = map(int, input().split())

if k <= a:
  print(k)
else:
  k -= a
  if k <= b:
    print(a)
  else:
    k -= b
    print(a + k * (-1))
# Judge status: Wrong Answer
S=input()
cnt=0
for i in range (3,len(S)+1):
    for j in range (i-3):
        if int(S[j:i+1])%2019==0:
            cnt+=1
print(cnt-1)
# Judge status: Accepted
a,b = map(int, input().split())
c = [1,3,5,7,8,10,12]
d = [4,6,9,11]
if a in c:
  if b in c:
    print('Yes')
  else:
    print('No')
elif a in d:
  if b in d:
    print('Yes')
  else:
    print('No')
else:
  print('No')
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
mi=0
ma=0
l=[]
count=0
for i in range(N):
 if a[i]<2800:
  l.append(a[i]//400)
 else:
  count=count+1

print(len(set(l))+min(1,count),len(set(l))+max(0,count))
# Judge status: Wrong Answer
from bisect import bisect_left, bisect_right

n = int(input())
a = sorted(map(int, input().split()))
b = sorted(map(int, input().split()))
c = sorted(map(int, input().split()))
ans = 0
print(a)
print(b)
print(c)
def bin_search(x, n, flag):
    if flag == True:
        return bisect_left(x, n)
    else:
        return bisect_right(x, n)



for i in range(n):
    ans += bin_search(a, b[i], True) * (n - bin_search(c, b[i], False))

print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
S = input()

ans = ""

for i in range(N):
    if i == K:
        ans += S[i].lower()
    else:
        ans += S[i]

print(ans)
# Judge status: Wrong Answer
H = int(input())
i = 1
while H > 1:
    H = -(-H//2)
    print("H=%d,i=%d" % (H,i))
    if H >= 1:
        i += 1
print(2**i-1)
# Judge status: Accepted
N = int(input())
S = set()
for i in range(N):
  S.add(input())
print(len(S))
# Judge status: Accepted
n = int(input())
s = input()

if s[n//2:] == s[:n//2]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
for i in range(1,n+1):
    print(a.count(i))
# Judge status: Wrong Answer
N, K = input().split();
N = int(N);
K = int(K);

amari = N % K;

hu = amari - K;

max_N = max(amari,hu);

print(max_N);
# Judge status: Accepted
X = int(input())
print(10 - X//200)
# Judge status: Accepted
#!/usr/bin/env python3

x = int(input())

if x == 3 or x == 5 or x == 7:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N , D = map(int, input().split())
print(-(-N//((D*2)+1)))
# Judge status: Accepted
n,m=map(int,input().split())
ab=[[int(j) for j in input().split()] for i in range(n)]
cd=[[int(j) for j in input().split()] for i in range(m)]

for a,b in ab:
  l=[abs(a-c)+abs(b-d) for c,d in cd]
  print(l.index(min(l))+1)
# Judge status: Wrong Answer
S = input()
ans = 1
tmp = S[0]
for i in range(len(S)-1):
    if tmp == S[i+1]:
        tmp += S[i+1]
    else:
        tmp = S[i+1]
        ans += 1
if ans <= len(S)//2:
    if len(S)%2 == 0:
        print((len(S)//2)+1)
    else:
        print((len(S)//2)+2)
else:
    print(ans)
# Judge status: Wrong Answer
s = str(input())

if s[0] != s[1] and s[0] != s[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys, math
from functools import lru_cache
from collections import deque

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    a = list(mi())
    b = list(mi())
    K = sum(b) - sum(a)

    if sum(max(0, (b[i]-a[i]+1)//2) for i in range(N)) <= K:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
# Judge status: Accepted
_, k = map(int, input().split())
d = {}
for i in map(int, input().split()):
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
d = sorted(d.values(), reverse=True)
print(sum(v for v in d[k:]))
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
#print(l)
l2 = list(reversed(l))
#print(l2)
#from itertools import combinations
#a = list(combinations(l, n-1))
#print(a)
from fractions import gcd
L, R = [0], [0]
for i in range(n):
    L.append(gcd(L[i],l[i]))
    R.append(gcd(R[i],l2[i]))
#print(L)
R = list(reversed(R))
#print(R)
g = []
for j in range(n):
    g.append(gcd(L[j],R[j+1]))
print(max(g))


#from functools import reduce

#def gcd_list(numbers):
#    return reduce(gcd, numbers)
# Judge status: Wrong Answer
X,Y = map(int,input().split())

print(X+Y/2)
# Judge status: Wrong Answer
N=int(input())
if N%2==0:
  print(N/2**2)
else:
  print((N//2)*((N//2)+1))
# Judge status: Wrong Answer
### import math
n,k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k):
    
    b = [0] * (n+1)
    #print(b)
    for j in range(n):
        l = max(0, j-a[j])
        r = min(j+a[j]+1, n)
        b[l] += 1
        b[r] -= 1
        print(b)
    for j in range(n):
        b[j+1] += b[j]
    b.pop()
    if(a == b):
        break
    a = b
        
ans = " ".join(map(str, a))
print(ans)
# Judge status: Wrong Answer
n, m = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
print(a)
for _ in range(m):
    idx = a.index(max(a))
    a[idx] //= 2
print(sum(a))
# Judge status: Accepted
n = int(input())
c = list(input())
r = 0
w = 0
for i in range(len(c)):
    if(c[i]=="R"):
        r += 1
ans = max(r,w)
for i in range(len(c)):
    if(c[i]=="R"):
        r -= 1
    else:
        w += 1
    now = max(r,w)
    ans = min(ans,now)
print(ans)
# Judge status: Accepted
import sys
l,r = map(int,input().split())
ans = int(2018)
if(r-l > 2020):
    print(0)
    sys.exit()
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            if((i*j)%2019 < ans):
                ans = (i*j)%2019
print(ans)
# Judge status: Wrong Answer
refN, renN, disN = map(int, input().split())

ref = list(map(int,input().split()))
ren = list(map(int,input().split()))

dis = [input().split() for _ in range(disN)]
 
minCost = 0

for kk in range(disN):
    cost = ref[int(dis[kk][0])-1] + ren[int(dis[kk][1])-1] - int(dis[kk][2])
    if minCost == 0 or cost < minCost:
        minCost = cost
 
ref.sort()
ren.sort()

cost = ren[0] + ref[0]
if cost < minCost:
    minCost = cost

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

if a > 0 and b > 0:
    print("Positive")
elif a == 0:
    print("Zero")
elif a < 0 and b > 0:
    print("Zero")
elif b == 0:
    print("Zero")
elif a < 0 and b < 0:
    diff = b - a
    if diff % 2 == 0:
        print("Negative")
    elif diff % 2 != 0:
        print("Positive")
# Judge status: Accepted
import collections
N = int(input())
A = [int(x) for x in input().split()]
c = collections.Counter(A)

tmp = 0
for k, v in c.items():
    if v < k:
        tmp += v
    else:
        tmp += (v - k)
print(tmp)
# Judge status: Accepted
import sys
import math

N, Q = map(int, input().split())
S = input()
a = [0 for _ in range(N)]

for i in range(1, N):
    if S[i-1]+S[i] == "AC":
        a[i] += 1 + a[i-1]
    else:
        a[i] += a[i-1]

for _ in range(Q):
    l, r = map(int, sys.stdin.readline().strip().split())
    print(a[r-1] - a[l-1])
# Judge status: Wrong Answer
import math

n,a,b = map(int,input().split())
numbers = []

for i in range(1,n+1):
    numbers.append(i)
numbers.remove(a)
numbers.remove(b)

if len(numbers) == 0:
    print('0')
else:
    sum_kinds = 0
    for i in numbers:
        a_kinds = math.factorial(n)/(math.factorial(i) * math.factorial(n-i))
        sum_kinds = sum_kinds + a_kinds

    print(sum_kinds % (10**9+7))
# Judge status: Accepted
a,b,k = map(int,input().split())
l = []
for i in range(100,0,-1):
    if a%i == 0 and b%i == 0:
        l.append(i)
print(l[k-1])
# Judge status: Accepted
N, K = map(int, input().split())
cnt = 0
for i in range(1, N+1):
    p = 0
    while i < K:
        i = i*2
        p += 1
    cnt += 1/2**p
print (cnt/N)
# Judge status: Accepted
N = int(input())
ans = 0
for n in range(1,N+1,2):
    sm = sum(n % i == 0 for i in range(1,n+1))
    if sm == 8:
        ans += 1
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

l = (n - a.count(2) + 1) // 2
count = 0
for i in a:
    if i % 4 == 0:
        count += 1

if l <= count:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int,input().split()))

C = Counter(A)
ans = 0
for i in range(10**5):
  c = C[i-1] + C[i] + C[i+1]
  ans = max(c,ans)
  
print(ans)
# Judge status: Wrong Answer
S = input()
lis_S = list(S)

a = "abcdefghijklmnopqrstuvwxyz"

for i in lis_S:
    a = a.strip(i)

if len(a) == 0:
    print("None")
else:
    print(a[0])
# Judge status: Accepted
from collections import Counter
N = int(input())
S = list(input())
ans = 10 ** 9
hash = [0] * (N + 1)
memo = 0
for i in range(N):
  if S[i] == "#":
    memo += 1
  hash[i + 1] = memo
dot = [0] * (N + 1)
memo = 0
for i in range(N - 1,-1,-1):
  if S[i] == ".":
    memo += 1
  dot[i] = memo    
for i in range(N + 1):
  ans = min(ans, hash[i] + dot[i])
print(ans)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")
import random
D = int(input())
c = [int(x) for x in input().split()]
s = []
for _ in range(D):
    s.append([int(x) for x in input().split()])
t = [random.randint(1, 26) for x in range(D)]
last = [0]*26
ans = 0
for i in range(1, D + 1):
    ans += s[i - 1][t[i - 1] - 1]
    last[t[i - 1] - 1] = i
    for j in range(26):
        ans -= c[j]*(i - last[j])
    #print(ans)
print(*t, sep="\n")
# Judge status: Accepted
K, N = map(int, input().split())
A = list(map(int, input().split()))

dA = []
for i in range(1, N):
    dA.append(A[i] - A[i-1])
    if i == N - 1:
        dA.append(A[0] - (A[i] - K))

dA = sorted(dA)
print(sum(dA[:N-1]))
# Judge status: Accepted
n = int(input())
a = [0]
for i in range(n):
  a.append(int(input()))
b = 1
for i in range(n):
  b = a[b]
  if b == 2:
    print(i + 1)
    break
else:
  print(-1)
# Judge status: Wrong Answer
N = int(input())
A = [list(map(int,input().split())) for i in list(range(N))]
B = [[i[0]-i[1], i[0]+i[1]] for i in A]
B.sort()
prev=B[0]
cnt=N
for i in range(1,N):
  if prev[1]>B[i][0]:
    cnt-=1
  else:
    prev=B[i]
print(cnt)
# Judge status: Accepted
N = int(input())


pair = [[0] * 10 for i in range(10)]


for num in range(1,N + 1):
    temp = str(num)
    temp1 = int(temp[0])
    temp2 = int(temp[-1])
    pair[temp1][temp2] += 1
    
total = 0
for i in range(1,10):
    for j in range(1,10):
        total += pair[i][j] * pair[j][i]
        
print(total)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
left_max = [0] * (N + 1)
right_max = [0] * (N + 1)

for index, a in enumerate(A, start=1):
    left_max[index] = max(left_max[index - 1], a)

for index, a in enumerate(reversed(A), start=1):
    right_max[index] = max(right_max[index - 1], a)

for i in range(N):
    print(max(left_max[i], right_max[N - i - 1]))
# Judge status: Accepted
print('2018/01/{}'.format(input()[8:]))
# Judge status: Accepted
K, S = map(int, input().split())
ans = 0
for x in range(K + 1) :
    if x > S :
        continue
    for y in range(K + 1) :
        if 0 <= S - x - y <= K :
            ans += 1
print(ans)
# Judge status: Accepted
M = 10 ** 6 + 1
N = int(input())
A = list(map(int, input().split()))

A.sort()
numbers = range(M)
not_divisible = [True] * (M)

result = 0
for i in range(N):
    target = A[i]
    if not_divisible[target]:
        if i+1 <= N-1 and A[i+1] == A[i]:
            pass
        else:
            result += 1
        for j in range(target, M, target):
            not_divisible[j] = False
print(result)
# Judge status: Accepted
N = int(input())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
      
print(num2alpha(N).lower())
# Judge status: Wrong Answer
nums = list(map(int, input().split()))
if nums.count(5) == 2 and nums.count(7) == 2:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
D, T, S = map(int,input().split())

X = D/S

if T > X:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
def main():
  s = int(input())
  #s = input()
  #s = input().split()
  #s = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 0
  count = 0
  lis = []
  
  while s >= 1:
    if s == 1:
      count += 1
      break
    elif s % 2 == 0:
      s //= 2
      count += 1
    else:
      s = s*3 + 1
      count += 1
  print(count+1)

if __name__ == '__main__':
  main()
# Judge status: Accepted
N = int(input())

ans = 0
word = {}
for i in range(N):
    S_word = sorted(input())
    key = "".join(S_word) 
    if key in word:
       word[key] += 1
       ans += word[key]
    else:
        word[key] = 0

print(ans)
# Judge status: Wrong Answer
n, y = map(int, input().split())
for i in range(1, n+1):
  for j in range(1, n+1):
    if ( i*10000 + j*5000 + (n-i-j)*1000 ) == y:
      print(i,j,(n-i-j))
      exit()
    if i+j+1 == n:
      break
print('-1 -1 -1')
# Judge status: Wrong Answer
import sys
from collections import deque
from collections import defaultdict
import math
import copy
#input = sys.stdin.readline
sys.setrecursionlimit(20000000)
s = input()
s = s[::-1]
n = len(s)
dp = [0]*(n+1)
k = 1
a = defaultdict(int)
a[0]+=1
for i in range(n):
  dp[i] = (dp[i-1]+int(s[i])*k)%2019
  k*=10
  k%=2019
  a[dp[i]] += 1
ans = 0
for i in a.keys():
  ans += a[i]*(a[i]-1)/2
print(ans)
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())

p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
p = p[:x]
q.sort(reverse=True)
q = q[:y]

apples = p + q + r
apples.sort(reverse=True)

print(sum(apples[:x+y]))
# Judge status: Accepted
n,a,b = map(int,input().split())
if (b-a)%2 == 0:
  print(min((b-a)//2,b-1,n-a))
else:
  print(min(b-1,n-a,a+(b-a-1)//2,n-b+1+(b-a-1)//2))
# Judge status: Wrong Answer
w = input()
for i in range(len(w)):
    if w.count(w[i])%2 !=0:
        print("No")
        break
    else:
        print("Yes")
        break
# Judge status: Wrong Answer
s = input()
t = input()
flag = False
for i in range(len(s)):
    if s == t:
        flag =True
    s = s[-1] + s[::len(s)-1]
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
def solve(N,A):
    ans = 1
    lis = []
    lis.append(A[0])
    a = A[0]
    for i in range(1,N):
        if len(lis)==1 or prev==0:
            prev = A[i]-a
        elif (A[i]-a)*prev<0:
            ans += 1
            lis = []
        lis.append(A[i])
        a = A[i]
    return ans
print(solve(N,A))
# Judge status: Wrong Answer
x,y = map(int,input().split())
if (x+y)<=23:
    print((x+y)%24)
else:
    print(x+y)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

t = a[0]
ans = 0

for i in range(1,n):
    if a[i] < t:
        ans += t-a[i]
    else:
        t = a[i]

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

d={}
for i in range(len(s)):
  si=s[i]
  ti=t[i]

  if si in d:
    d[si]+=[ti]
  else:
    d[si]=[ti]
for k in d.keys():
  if len(set(d[k]))!=1:
    print('No')
    exit()
print('Yes')
# Judge status: Accepted
s = input()
tmp = set(s)

if len(tmp) == 2:
    for c in tmp:
        if s.count(c) != 2:
            print('No')
            exit()
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
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])

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

  return arr

n = int(input())

s = 1
for i in range(2, n+1):
  ls = factorization(i)
  for j in ls:
    s += i*(j[1]+1)

print(s)
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())

if H >= W:
  if H%2 != 0:print(N//H + 1)
  else: print(N//H)
else:
  if W%2 != 0:print(N//W + 1)
  else: print(N//W)
# Judge status: Wrong Answer
W, H, x, y = map(int, input().split())
print(W * H / 2, int((0 < x < W)&(0 < y < H)))
# Judge status: Wrong Answer
import itertools

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

nums = []
for _ in range(q):
    nums.append(list(map(int, input().split())))

total = 0

l = [1,2,3,4,5,6,7,8,9,10]
for v in itertools.combinations_with_replacement(l, n):
    scores = []
    for a,b,c,d in nums:
        if v[b-1]-v[a-1] == c:
            scores.append(d)
    if total <= sum(scores):
        total = sum(scores)

print(total)
# Judge status: Wrong Answer
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, T = list(map(int, sys.stdin.readline().split()))
    ct = [list(map(int, sys.stdin.readline().split()))for i in range(N)]

    ret = float('inf')
    for n in range(N):
        if T >= ct[n][1] and ret > ct[n][0]:
            ret = ct[n][0]

    print('LTE' if ret == float('inf') else ret)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N,M = map(int,input().split())
place = [list(map(int,input().split())) for _ in range(N)]
check = [list(map(int,input().split())) for _ in range(M)]
for x,y in place:
    tmp = 10**9
    for i in range(M):
        dis = abs(x-check[i][0]) + abs(y-check[i][1])
        if tmp > dis:
            tmp = dis
            ans = i+1
    print(ans)