peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
l=[[a] for a in A]
for i in range(N):
  l[i].append(i+1)
l.sort()
for i in range(N):
  print(l[i][1],end=" ")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
total = sum(a)
total_a, total_b = 0, 0
i = 0
while total_a + a[i] <= total / 2 and total_b + a[n - i - 1] <=  total / 2:
    total_a += a[i]
    total_b += a[n - i - 1]
    i += 1
print(total - max(total_a, total_b) * 2)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

ans = [0] * N
for i,a in enumerate(A):
  ans[a-1] = i+1

print(*ans)
# Judge status: Accepted
#!/usr/bin/env python3
x,y = map(int,input().split())
ans = 2*10**9+1
if y-x >= 0:
    ans = min(ans,y-x)
if x-y >= 0:
    ans = min(ans,x-y+2)
if y+x >= 0:
    ans = min(ans,y+x+1)
if -x-y >= 0:
    ans = min(ans,-y-x+1)
print(ans)
# Judge status: Accepted
n,k,q = map(int,input().split())
a = [0 for i in range(q)]
t = [0 for i in range(n)]
for i in range(q):
    a[i] = int(input())
    t[a[i]-1] += 1
for i in range(n):
    if t[i] + k > q:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n,k= list(map(int, input().split()))
x= list(map(int, input().split()))
li=[]
for i in range(n-k+1):
    li.append(x[k+i-1]-x[i]+min(abs(x[k+i-1]),abs(x[i])))
print(min(li))
# Judge status: Accepted
A, B = map(int, input().split())

def prime_factorize(n):
    res = set()
    i = 2
    while i * i <= n:
        if n % i == 0:
            res.add(i)
            while n % i == 0:
                n //= i
        i += 1
    if n != 1:
        res.add(n)
    return res

ans = prime_factorize(A) & prime_factorize(B)
print(len(ans) + 1)
# Judge status: Wrong Answer
n,k = map(int, input().split())
 
for i in range(1,10):
  if n <= k ** i - 1:
    print(i)
    break
# Judge status: Accepted
n,a,b = map(int,input().split())
cnt = 0
mod = 1000000007

def C(n,k):
    x = 1
    y = 1
    for i in range(k):
        x *= n-i
        y *= i+1
        x %= mod
        y %= mod
    return x*pow(y,mod-2,mod)%mod

cnt += pow(2,n,mod) - 1
cnt -= C(n,a)
cnt -= C(n,b)

print(max(0,cnt%mod))
# Judge status: Wrong Answer
#a,b=map(int,input().split())
#s=input()
a,b=3, 4
s="269-6650"

ans="No"
if len(s)==a+b+1:
  if s[a]=="-":
    if s[0:a].isdigit() and s[b:len(s)].isdigit():
      ans="Yes"
    
print(ans)
# Judge status: Wrong Answer
def divisors(n):
    s = set()
    for x in range(2, int(n ** 0.5) + 1):
        if n % x == 0:
            s.add(x)
            s.add(n // x)
    return s

a, b = map(int, input().split())
d = divisors(a) & divisors(b)
print(len(d) + 1)
# Judge status: Wrong Answer
s = input()
k = int(input())
d = {}
dd = {}
for i, ss in enumerate('abcdefghijklmnopqrstuvwxyz'):
    d[ss] = i
    dd[i] = ss
ans = ''

for ss in s[:-1]:
    if k >= 26 - d[ss]:
        k -= 26 - d[ss]
        ans += 'a'
    else:
        ans += ss
k = (d[s[-1]] + k) % 26
ans += dd[k]
print(*ans, sep='')
# Judge status: Accepted
import sys

n, m, *ab = map(int, sys.stdin.read().split())
ab = sorted(zip(*[iter(ab)] * 2))

def main():
    cost = 0
    r = m
    for a, b in ab:
        if b <= r:
            cost += a * b
            r -= b
        else:
            cost += a * r
            break
    return cost

if __name__ == '__main__':
    ans = main()
    print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())
print(-1 if a == b else a)
# Judge status: Accepted
import math
A, B = map(int, input().split(' '))
print((A * B) // math.gcd(A, B))
# Judge status: Accepted
N=int(input())
List=[input() for i in range(N)]
print(len(list(set(List))))
# Judge status: Accepted
# dp answer
N = int(input())
dp = [N for i in range(N+1)]
dp[0] = 0
Y = [1] + [6**i for i in range(1, 10) if 6**i <= N] + [9**i for i in range(1, 10) if 9**i <= N]
Y = sorted(Y)
for i in range(1, N+1):
    for y in Y:
        if i-y < 0:
            break
        dp[i] = min(dp[i], dp[i-y]+1)
print(dp[N])
# Judge status: Accepted
a = list(map(int,input().split()))
a.sort()
if a[-1]%2 == 0:
    print(0)
else:
    print(a[0]*a[1])
# Judge status: Accepted
import math
ary1 = [int(input()) for x in range(5)]
x1 = sum(10*math.ceil(x/10) for x in ary1)
x2 = max([10-(y % 10) if y % 10 !=0 else 0 for y in ary1 ])
ans = x1 - x2
print(ans)
# Judge status: Accepted
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()

ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])
        if c > b:
            ans += c - 1 - b

print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
a = list(map(int, input().split()))

import functools


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


def multiple(a, b):
    return a * b // euclid(a, b)


def lcm(nums):
    return functools.reduce(multiple, nums)


for i in range(len(a)):
    a[i] = a[i]//2

min = lcm(a)

#M = M // 2

Sum = 0

x = 1
while min * x <= M:
    #print(min*x,M)
    Sum += 1
    x += 2

print(Sum)
# Judge status: Accepted
import math

n, k = map(int, input().split())
ans = 0
x = [max(0, math.ceil(math.log2(k / i))) for i in range(1, n + 1)]
for i in x:
    ans += ((2 ** i) * n) ** -1 
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline
from collections import defaultdict

def main():

    N = int(input())
    a = list(map(int,input().split()))
    pl = defaultdict(int)
    ans = 0
    for i,num in enumerate(a):
        s = num+i
        t = num-i
        ans += pl[-t]
        pl[s] += 1

    print(ans)
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
a,b = [0],[0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])
  
ans = 0
j = M
for i in range(N + 1):
  if(a[i] > K):
    break
  while(a[i] + b[j] > K):
    j -= 1
  ans = max(ans, i+j)
print(ans)
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))

dummy = 2*10**5
answer = 0

for p in P:
  if p <= dummy:
    answer += 1
    dummy = p

print(answer)
# Judge status: Accepted
k, s = map(int, input().split())
ans = 0
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if z >= 0 and z <= k:
      ans += 1
print(ans)
# Judge status: Wrong Answer
ip1 = input()
ip1list = ip1.split(" ")
N = int(ip1list[0])
M = int(ip1list[1])
ip2 = input()
A_sub = ip2.split(" ")
A = []
for a in A_sub:A.append(int(a))

for a in A:
    N -= a
if N<=0:
    print(-1)
else:
    print(N)
# Judge status: Wrong Answer
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print("Good")
else:
    print('Bad')
# Judge status: Wrong Answer
# input
S = list(input())
N = len(S)

# check
cnt = 0
del_ind = []
append = del_ind.append

for i in range(1, N):
    if "".join(S[i - 1:i + 1]) in ["01", "10"]:
        cnt += 2
        N -= 2
        del S[i - 1:i + 1]
print(cnt)
# Judge status: Accepted
N = int(input())
lls = []
rls = []
sels = []
for _ in range(N):
    x,l = map(int, input().split())
    lls.append(x-l)
    rls.append(x+l)
    sels.append([x-l,x+l])

sels = sorted(sels,key=lambda x:x[1])

start = -float('inf')

ans = 0
for item in sels:
    if start <= item[0]:
        ans += 1
        start = item[1]

print(ans)
# Judge status: Wrong Answer
(a, b, c) = map(int, input().split())
print(max(10 * a + b + c, a + 10 * b + c))
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))
for k in range(K):
    imos = [0] * (N+1)
    for i,a in enumerate(A):
        l = max(0, i-a)
        r = min(N, i+1+a)
        imos[l] += 1
        imos[r] -= 1
    imos[0] = min(N, imos[0])
    for i in range(N):
        imos[i+1] = min(N, imos[i] + imos[i+1])
    A = imos[:-1]
    if all(a==N for a in A):
        break
print(*A)
# Judge status: Accepted
#全然わからん
a, b, c = map(int, input().split())

m = max(a, b, c)
ans = 0
if 3 * m % 2 == (a + b + c) % 2 :
    ans = (3 * m - (a + b + c)) // 2
else:
    ans = (3 * (m + 1) - (a + b + c)) // 2
print(ans)
# Judge status: Wrong Answer
N = int(input())

ans = 0

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()
    return divisors

for i in range(N):
    num = len(make_divisors(i))
    ans += num
    print(ans)


print(ans)
# Judge status: Wrong Answer
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = str(input())
i = 0
point = 0
for i in range(N):
  if T[i] == "r" and T[i-K] != "p":
    point += P
  elif T[i] == "s" and T[i-K] != "r":
    point += R
  elif T[i] == "p" and T[i-K] != "s":
    point += S
  else:
    break
  i += 1
print(point)
# Judge status: Wrong Answer
import collections
L01=collections.defaultdict(dict)
N=int(input())
L1=list(input() for _ in range(N))
M=int(input())
L2=list(input() for _ in range(M))
for i in set(L1):
    L01[i]=L1.count(i)
for i in set(L2):
    L01[i]=-L2.count(i)
print(max(L01.values()) if max(L01.values())>=0 else 0)
# Judge status: Accepted
S = int(input())
se = {S}
x = S
for i in range(2, 1000001):  
  if x%2 == 0:
    x = x//2
  else:
    x = 3*x+1
  if x in se:
    print(i)
    exit()
  se.add(x)
# Judge status: Accepted
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(M)]
for i in range(N):
    ans = -1
    dist = 10**12
    for j in range(M):
        tmp = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]) 
        if tmp < dist:
            ans = j
            dist = tmp
    print(ans+1)
# Judge status: Wrong Answer
a = input()
b = input()

if a in b and (len(a) + 1) == len(b) and b.islower():
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N,M=map(int,input().split())
l=list()
for i in range(N):
    A=list(map(int,input().split()))
    del A[0]
    l+=A
result=0
for i in range(M):
    if l.count(i+1)==N:
        result+=1
print(result)
# Judge status: Wrong Answer
import sys
from math import gcd

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, x, *X = map(int, read().split())

    ans = X[0] - x
    for i in range(1, N):
        ans = gcd(ans, X[i] - x)

    print(ans)
    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a <= 8 and b <= 8:
  print('Yay')
else:
  print(':(')
# Judge status: Wrong Answer
s=input()
n=len(s)
for i in range(n-1,-1,-1):
    if s[i]=='T':
        p=i+1
        break
else:
    p=0
k=s[:p].count('T')
l=s[:p].count('S')
print(n-p+abs(s[:p].count('T')-s[:p].count('S')))
# Judge status: Accepted
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
l = []

for i in range(n):
    ans = abs((t -h[i] * 0.006) - a )
    l.append(ans)

x = (min(l))

print(l.index(x) + 1)
# Judge status: Wrong Answer
def partpall(s,n):
	if s!=s[::-1]:
		return False
	else:
		return True

def pall(s,n):
	if s!=s[::-1]:
		return False
	return partpall(s[n//2 +1 :],n) and partpall(s[:n//2 ],n)


# s=input("enter:")
s="akakaka"
# print("sucess",s,s[::-1])
# revStr=s[::-1]
n=len(s)
print(n)
if pall(s,n):
	print("True")
else:
	print("False")
# Judge status: Accepted
n = int(input())
s = str(input())
t = str(input())
val = s+t
for i in range(min(len(s),len(t))):
  if s[-1-i:] == t[:i+1]:
    val = s+t[i+1:]
 
print(len(val))
# Judge status: Accepted
a,b,c = map(int, input().split())
flg = 0
for i in range(1,101):
  tmp = a * i % b
  if tmp == c:
    flg = 1
if flg == 1:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
import math
N,K=map(int,input().split())
A=list(map(int,input().split()))
saishou=A.index(1)
if saishou==0:
    answer=math.ceil((N-1)/(K-1))
    print(answer)
elif saishou+1<=K:
    answer=1+math.ceil((N-K)/(K-1))
    print(answer)
elif N-saishou<=K:
    answer=math.ceil((N-K)/(K-1))+1
    print(answer)
else:
    print(math.ceil(saishou/(K-1))+math.ceil((N-1-saishou)/(K-1)))
# Judge status: Accepted
def myAnswer(N,M,L,R) -> int:
   MAXL=max(L)
   MINR =min(R)
   ans = [i for i in range(1,N+1) if(MAXL<= i and MINR >= i)]
   return len(ans)


def modelAnswer():
   tmp=1
def main():
   N, M = map(int,input().split())
   L =[]
   R = []
   for _ in range(M):
      l,r = map(int,input().split())
      L.append(l)
      R.append(r)
   print(myAnswer(N,M,L[:],R[:]))
   

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

if s[0] !="A":
    print("WA")
    exit()

cnt=0
for i in range(2,len(s)-1):
   if s[i] == "C":
       cnt+=1
if cnt!=1:
    print("WA")
    exit()

for i in range(1,len(s)):
    if s[i] == "C" and 2<=i<len(s)-1:
        continue
    if not s[i].islower():
        print("WA")
        exit()
print("AC")
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    D = int(input())
    C = [int(x) for x in input().split()]
    S = [[int(x) for x in input().split()] for _ in range(D)]


    for i in range(D):
        print(i % 26 + 1)



if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
dishes = list(map(int, input().split()))
satisfaction = list(map(int, input().split()))
additional = list(map(int, input().split()))

res = 0

for i in range(N-1):
    res += satisfaction[i]

    if dishes[i] + 1 == dishes[i+1]:
        res += additional[dishes[i] - 1]
    
    print(res)

print(res + satisfaction[-1])
# Judge status: Accepted
from sys import stdin
na=lambda: map(int,stdin.readline().split())

n,m=map(int,input().split())
a=sorted(list(na()))
l=[list(na()) for i in range(m)]
l=sorted(l,key=lambda x:x[1], reverse=True)

p=0
comp=[]
for b,c in l:
  comp+=[c]*b
  p+=b
  if p>=n:
    break

ans=0
for i in range(n):
  if i<len(comp):
    ans+=max(a[i],comp[i])
  else:
    ans+=a[i]
print(ans)
# Judge status: Wrong Answer
n, m, x = list(map(int, input().split()))
c = []
a = []

for i in range(n):
    tmp = list(map(int, input().split()))
    c.append(tmp[0])
    a.append([])
    
    for j in range(m):
        a[i].append(tmp[j])

ab = []
for i in range(m):
    sum = 0
    for j in range(n):
        sum += a[j][i]
    ab.append(bool(sum > x))

print(300 if all(ab) else -1)
# Judge status: Accepted
K = int(input())
S = str(input())

if len(S) <= K:
    print(S)
else:
    print(S[:K] + "...")
# Judge status: Accepted
def atc_120a(input_value: str) -> int:
    A, B, C = map(int, input_value.split(" "))
    return min(C, B // A)

input_value = input()
print(atc_120a(input_value))
# Judge status: Accepted
a,b,c=map(int,input().split())

if c-a-b>0 and 4*a*b<(c-b-a)*(c-a-b):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a<b and v<=w:
    print("NO")
elif w>v:
    print("NO")
else:
    if abs(b-a)<=t*abs(v-w):
        print("YES")
    else:
        print("NO")
# Judge status: Accepted
# coding: utf-8
import math
import numpy
#N = int(input())
a, b, c = map(int,input().split())
#A = list(map(int,input().split()))
K =int(input())
flg = False
i = 0
while a >= b:
    if i == K:
        break
    b *= 2
    i += 1
    
    #print(i,a,b,c)
while b >= c:
    if i == K:
        break
    c *= 2
    i += 1
    #print(a,b,c)
#print(a, b, c)
if a < b < c:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import math

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

def turn(arr, m):
    sum_ = 0
    for i in range(m):
        res =  math.factorial(m - (i + 1)) * (arr[i] - (i + 1))
        if res > 0:
            sum_ =+ res
    
    return sum_

ans = abs(turn(p, n) - turn(q, n))
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
print(sum(p[:k]))
# Judge status: Accepted
N = int(input())
XL = [list(map(int,input().split())) for _ in range(N)]
r_l = []
for n in range(N):
  xl = XL[n]
  x = xl[0]
  l = xl[1]
  r_l.append([x-l,x+l])

r_l = sorted(r_l,key = lambda x:x[1])
ans = 1
l = r_l[0][1]
for a in r_l:
  if a[0]<l:
    continue
  else:
    ans += 1
    l = a[1]
    
print(ans)
# Judge status: Wrong Answer
n=input()
nn=int(n)
min_n=9999999999999
for i in range(len(n)-1):
    a=10**i
    b=nn-a
    s=1
    for j in range(5):
        s+=b%10
        b=b//10
    min_n=min(min_n,s)
for i in range(len(n)-1):
    b=10**i
    a=nn-b
    s=1
    for j in range(5):
        s+=a%10
        a=a//10
    min_n=min(min_n,s)
print(min_n)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
MOD = 10**9 + 7

S = 0
ans = 0
for a in A:
    ans = (ans + a * S) % MOD
    S += a
print(ans)
# Judge status: Wrong Answer
h,a=map(int,input().split())
print(h//a+1)
# Judge status: Wrong Answer
n, k = map(int, input().split())
A = list(map(int, input().split()))

for i in range(min(30, k)):
    DP = [0] * (n+1)
    for j in range(n):
        light = A[j]
        DP[max(0, j-light)] += 1
        DP[min(n, j+light+1)] -= 1

    for j in range(1, n):
        DP[j] += DP[j-1]

    A = DP[:-1]

print(*A)
# Judge status: Accepted
#!/usr/bin/env python3
N, M = [int(str) for str in input().strip().split()]

divs = []
for i in range(1, int(M**0.5) + 1):
    if M % i == 0:
        divs.append(i)
        if i**2 != M:
            divs.append(M // i)

divs.sort(reverse=True)

for div in divs:
    if M // div >= N:
        print(div)
        exit()
# Judge status: Wrong Answer
n,k=map(int,input().split())
x=list(map(int,input().split()))

ans=float('inf')
for i in range(n-k+1):
    temp=x[i+k-1]-x[i]+abs(x[i])
    if ans>temp:ans=temp
print(ans)
# Judge status: Accepted
x = int(input())

for i in range(1,x+1):
  if i*(i+1)//2 >= x:
    print(i)
    exit()
# Judge status: Accepted
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N = II()
    A = LI()
    numa = len(set(A))
    #print(numa)
        
    if numa == N:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
	main()
# Judge status: Wrong Answer
import sys
import math
import itertools
import numpy

rl = sys.stdin.readline

n, k= map(int, rl().split())
li = [[0, 0] for _ in range(n)]
for _ in range(k):
    a, b = rl().split()
    b = b.rstrip()
    a = int(a) - 1
    if b == 'WA':
        li[a][0] += 1
    elif li[a][1] == 0:
        li[a][1] = 1
ac = 0
wa = 0
for lis in li:
    i, v = lis
    wa += i
    if v == 1:
        ac += 1
print(ac, wa)
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
dp=[float("INF")]*n
dp[0]=0
for i in range(2,n):
  for j in range(1,3):
    dp[i]=min(dp[i-j]+abs(l[i]-l[i-j]),dp[i])
print(dp[-1])
# Judge status: Accepted
w,h,n=[int(x) for x in input().split()]
p=[[int(x) for x in input().split()] for _ in range(n)]

minx=0
maxx=w
miny=0
maxy=h

for i in range(n):
    if p[i][2]==1:
        minx=max(minx,p[i][0])
    if p[i][2]==2:
        maxx=min(maxx,p[i][0])
    if p[i][2]==3:
        miny=max(miny,p[i][1])
    if p[i][2]==4:
        maxy=min(maxy,p[i][1])
w=maxx-minx
h=maxy-miny
print(w*h if w>0 and h>0 else 0)
# Judge status: Wrong Answer
N,K=map(int,input().split())
M=N+1
L=K-1
print(M*(M*M+5)/6 + L*(L*L*2+L*3-5-M*(L+1)*3)/6%10**9+7)
# Judge status: Accepted
# print('input >>')
N = int(input())
As = list(map(int,(input().split())))

tashi = {}
hiki = {}

for i in range(len(As)):
    sum_ = i + As[i]
    sub_ = i - As[i]
    if not sum_ in tashi:
        tashi[sum_] = 0
    if not sub_ in hiki:
        hiki[sub_] = 0
    tashi[sum_] += 1
    hiki[sub_] += 1

ans = 0

for k, v in tashi.items():
    if k in hiki:
        ans += v * hiki[k]

# print('-----output-----')
print(ans)
# Judge status: Wrong Answer
n = int(input())
ls = list(map(int,input().split()))
di = [0]*n
new = []
k = 0
for i in range(n):
    if ls[i] == i+1:
        di[i] = 1
        k += 1
    else:
        if k > 1:
            new.append(k)
        k = 0
if k > 1:
    new.append(k)
print(sum(di)-len(new))
# Judge status: Wrong Answer
a,b=input(),input()
print('YES' if reversed(list(a))==list(b)else 'NO')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

b =[0]*(n+1)

ans = 0

for i in range(n):
  j = n-i
  sum = 0
  m = 1
  while j*m <= n:
    sum += b[j*m]
    m += 1
  if sum % 2 != a[j-1]:
    b[j] = 1 
    ans += 1
    


if not 1 in b:
  print(0)
else:
  print(ans)
  for i in range(n+1):
    if b[i] == 1:
      print(i, end =' ')
# Judge status: Wrong Answer
# C - XYZ Triplets
from collections import Counter


def main():
    """
    if x = y = z and n = 1000,
        6 * x^2 = 1000
        x ≈ 13.038 -> lim = 14
    """
    N = int(input())
    calc = lambda x, y, z: x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    cnt = Counter(
        calc(i, j, k) for i in range(1, 15) for j in range(1, 15) for k in range(1, 15)
    )
    res = [cnt[i] for i in range(1, N + 1)]
    print("\n".join(map(str, res)))


if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import Counter


def f(x):
    print("{} x {}".format(x, c[x]))


n = int(input())
s = [input() for _ in range(n)]

c = Counter(s)

f("AC")
f("WA")
f("TLE")
f("RE")
# Judge status: Accepted
input();a,b1,b2,b4=list(map(int,input().split())),0,0,0
for i in a:
  if i%2!=0: b1+=1
  elif i%4==0: b4+=1
  else: b2+=1
print(['NYoe s'[b1<=b4::2],'NYoe s'[b1<=b4+1::2]][not b2])
# Judge status: Accepted
A,B,C,X,Y = map(int,input().split())
if X<Y:
    print(min(A*X+B*Y,Y*C*2,X*C*2+B*(Y-X)))
else:
    print(min(A*X+B*Y,X*C*2,Y*C*2+A*(X-Y)))
# Judge status: Accepted
N = int(input())
As = [0]+list(map(int, input().split()))

memo = [0]*(N+1)

for i in range(N,0,-1):
  j = 2
  cnt = 0
  while i*j <= N:
    cnt ^= memo[i*j]
    j += 1
  memo[i] = cnt^As[i]
  
print(sum(memo))
rlt = []
for i in range(1,N+1):
  if memo[i] == 1:
    rlt.append(i)
    
print(' '.join(map(str, rlt)))
# Judge status: Accepted
s=list(set(list(input())))
s.sort()
alphabet=list("abcdefghijklmnopqrstuvwxyz")
for i in s:
    alphabet.remove(i)
    
if alphabet==[]:
    print("None")
else:
    print(alphabet[0])
# Judge status: Accepted
N, M = map(int, input().split())

res = 0
res += min(N, M//2)
M -= N*2

res += max(M//4, 0)

print(res)
# Judge status: Accepted
N = int(input())

count = 0
for i in range(N):
  d1,d2 = map(int,input().split())
  if(d1==d2):
    count = count + 1
  else:
    count = 0
  if(count == 3):break
if(count == 3):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N,D=map(int,input().split())
c=0
X=[]
for i in range(N):
  X.append(list(map(int,input().split())))

for j in range(N):
  for k in range(j+1,N):
    tmp=sum([(X[j][l]-X[k][l])**2 for l in range(D)])
    if tmp in [y**2 for y in range(21)]:
      c +=1
print(c)
# Judge status: Accepted
N, K = map(int, input().split(" "))
# print(N, K)

people = []

for i in range(0, K):
  d = int(input())
  A = list(map(int, input().split(" ")))
  # print(d, A)
  for j in range(d):
    people.append(A[j])

# print(people)
print(N - len(set(people)))
# Judge status: Accepted
import numpy as np

S = input()
cond1 = (S[0] == 'A')

cntC = S.count('C', 2, len(S)-1)
cond2 = (cntC == 1)

cnt_lower = 0
for c in S:
    if c.islower():
        cnt_lower += 1
cond3 = (cnt_lower == len(S)-2)

if(cond1 and cond2 and cond3):
    print("AC")
else:
    print("WA")
# Judge status: Wrong Answer
import sys
n,k=map(int,input().split())
pp = list(map(int,input().split()))
s=[0]*n
for i,p in enumerate(pp):
  if i==0:
    s[0] = (1+p)/2
  else:
    s[i] = s[i-1]+(1+p)/2
res =0 
for i in range(n-k):
  if res < s[i+k] - s[i]:
    res = s[i+k]-s[i]
print(res)
# Judge status: Accepted
N,X=map(int,input().split())
x=list(map(int,input().split()))
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)
X=abs(X-x[0])
for i in range(N-1):
  X=gcd(max(X,abs(x[i+1]-x[i])),min(X,abs(x[i+1]-x[i])))
print(X)