peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a, b = input().split()
ab = int(a + b)

for i in range(1, 150):
    if i**2 == ab:
        print("Yes")
        break
else:
    print("No")
# Judge status: Wrong Answer
S = input()
# L = len(S) % 2
youtube = 0
ようつべ = 0
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == "L" or S[i] == "U" or S[i] == "D":
      youtube += 1
  else:
    ようつべ += 1
# if S[2] % 2 == 0:
if youtube == 1:
  print("Yes")
elif ようつべ == 1:
  print("No")
# Judge status: Wrong Answer
x,y = map(int,input().split())
mod = 10**9+7
s = 0
if x<0 or y<0:
  print(s)
  exit()
mx = 10**6
fact = [1]*(mx+1)
for i in range(mx):
  fact[i+1] = fact[i]*(i+1)%mod
def inv(n):
  return pow(n,mod-2,mod)
if (x%3==0 and y%3==0) or (x%3==1 and y%3==2) or (x%3==2 and y%3==1):
  n = int(2*x/3-y/3)
  m = int(-x/3 + 2*y/3)
  s += fact[n+m]*inv(fact[n])*inv(fact[m])%mod
  print(s)
# Judge status: Accepted
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


a = S()
ans = 0
for i in a:
    if i == '1':
        ans += 1
print(ans)
# Judge status: Accepted
# solution

nim,mike=map(int,input().split())

array=[]

for i in range(mike):
    p,y=map(int,input().split())
    array.append([i,p,y])

PY_sort=sorted(array,key=lambda x: x[2])

k=list(range(1,10**5+1))

v=[0]*10**5

cnt_dict=dict(zip(k,v))

arr=[]

for i,j,k in PY_sort:
    cnt_dict[j]+=1
    arr.append([i,str(j).zfill(6)+str(cnt_dict[j]).zfill(6)])

s = sorted(arr, key=lambda x: x[0])

for a,b in s:
    print(b)
# Judge status: Accepted
S = input()
T = input()
ans = len(T)
n1 = len(S)-len(T)+1
for i in range(n1):
    ans2 = 0
    for k in range(len(T)):
        # print(S[k+i],T[k])
        if S[k+i] != T[k]:
            ans2 += 1
    
    ans = min([ans,ans2])
    # print(ans)
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
aaa = [input() for _ in range(n)]
bbb = [input() for _ in range(m)]
ans = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        flag = True
        for k in range(m):
            for l in range(m):
                if aaa[i + k][j + l] != bbb[k][l]:
                    flag = False
        if flag:
            ans = True
if ans:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,X = map(int,input().split())
L = list(map(int,input().split()))
ans = 1

for i in range(N):
    if sum(L[:i+1]) <= X:
        ans += 1
    else:
        break
    
print(ans)
# Judge status: Wrong Answer
k = int(input())
answer = -1
cou = 7
for i in range(k+1):
	if cou%k == 0:
		answer = cou
	else:
		cou*10 + 7
print(answer)
# Judge status: Accepted
n,a,b=map(int,input().split())

if a>b:
    print(0)
    exit()
if n==1:
    if a!=b:
        print(0)
        exit()

if n==1 and a==b:
    print(1)
    exit()
print((n-2)*(b-a)+1)
# Judge status: Wrong Answer
N, M = map(int,input().split())
students = []
points = []
for _ in range(N):
    students.append(list(map(int,input().split())))
for _ in range(M):
    points.append(list(map(int,input().split())))

for i in range(N):
    MIN = 10 ** 8
    index = -1
    for j in range(M):
        if MIN > abs(students[i][0] - points[j][0]) + abs(students[i][1] - points[j][1]):
            MIN = abs(students[i][0] - points[j][0]) + abs(students[i][1] - points[j][1])
            index = j
    print(index + 1)
# Judge status: Wrong Answer
s=input()
if s == 'abc':
  print('arc')
else:
  print('abc')
# Judge status: Wrong Answer
N=int(input())
X=list(map(int,input().split()))
for i in range(N):
  if i<N//2:
    print(X[N//2])
  else:
    print(X[N//2-1])
# Judge status: Accepted
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7

n=int(input())
s=input()
i=0
leftcnt=0
rightcnt=0
for i in range(len(s)):
    if s[i]==")":
        if leftcnt==0:
            rightcnt+=1
        else:
            leftcnt-=1
    else:
        leftcnt+=1
print("("*rightcnt+s+")"*leftcnt)
# Judge status: Wrong Answer
a=input().split(' ')
A=int(a[0])
B=int(a[1])
if A>B:
  print('Alice')
elif A==B:
  print('Draw')
else:
  print('Bob')
# Judge status: Accepted
n,m = list(map(int, input().split()))

box = [1] * (n+1) 
redbox = [False] * (n+1) 
redbox[1] = True
for _ in range(m):
    x,y = list(map(int, input().split()))
    box[x]-=1
    box[y]+=1
    if redbox[x]:
        redbox[y] = True
    if box[x]==0:
        redbox[x] = False
#    print(box)
#    print(redbox)
print(sum(map(int, redbox[1:])))
# Judge status: Wrong Answer
n,k=map(int,input().split())
l=[]
count=0
for _ in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    l+=a
for i in range(1,n+1):
    if i in l:
        count+=1
print(count)
# Judge status: Accepted
K = int(input())
S = input()

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

print(ans)
# Judge status: Accepted
N = int(input())
A = {}
for i in range(N):
  A[i+1] = int(input())
B = [-1 for i in range(N+1)]
B[1] = 0
i = 1
while 1:
  j = A[i]
  if j == 2:
    print(B[i] + 1)
    break
  elif B[j] != -1:
    print(-1)
    break
  else:
    B[j] = B[i] + 1
    i = j
# Judge status: Accepted
N = int(input())
T = []
for i in range(N):
   T.append(tuple(map(int, input().split())))

T = sorted(T, key=lambda x:x[1])
t = 0
for a, b in T:
  t += a
  if t > b:
    print("No")
    quit()
print("Yes")
# Judge status: Wrong Answer
from collections import Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
if n<=k:
    print(0)
else:    
    c = Counter(a)
    cv = sorted(c.values())
    ans+=sum(cv[:k-1])
    print(ans)
# Judge status: Accepted
N=int(input())

a=N//100
b=(N%100)//10
c=(N%100)%10

if a==7 or b==7 or c==7:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
a = sorted([i//400 for i in a])
min = 0
max = 0
flag = -1
for i in range(n):
  if a[i] >= 8:
    max += 1
  elif flag != a[i]:
    min += 1
    max += 1
  flag = a[i]
print(min,max)
# Judge status: Accepted
N = int(input())
A = [2, 4 , 5, 7, 9]
B = [0, 1, 6, 8]
C = [3]

if N%10 in A:
  print("hon")
if N%10 in B:
  print("pon")
if N%10 in C:
  print("bon")
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
i = 1
while i ** 2 <= N:
    i += 1
    if i ** 2 > N:
        print((i - 1) ** 2)
        sys.exit()
# Judge status: Accepted
#!/usr/bin/env python3
n = int(input())
if (n % 11) == 0: print((n // 11)*2) 
elif n % 11 <= 6: print((n // 11)*2 + 1)
else: print((n // 11)*2 + 2)
# Judge status: Accepted
x,y=map(int,input().strip().split())
nums = list(map(int, input().strip().split()))
ans=0
if y==0:
  print(x)
elif x not in nums:
  print(x)
else:
  for i in range(0,102):
    if i not in nums:
      if abs(x-i)<abs(x-ans):
        ans=i
  print(ans)
# Judge status: Wrong Answer
x,y=map(int,input().split())
A=[1,3,5,7,10,12]
B=[4,6,9,11]
C=[2]
print("Yes" if x in A and y in A else "Yes" if x in B and y in B else "Yes" if x in C and y in C else "No")
# Judge status: Accepted
s = list(input())
K = int(input())
def plus(c,i):
    return chr((ord(c)-ord('a')+i)%26+ord('a'))
# 上から順に回るなら回す
for i,ss in enumerate(s):
    want = (ord('z') + 1 - ord(ss))%26
    if K >= want:
        s[i] = plus(s[i],want)
        K = K - want
    
K = K % 26
if K >= 1:
    s[-1] = plus(s[-1],K)
print("".join(s))
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

from itertools import permutations, combinations,combinations_with_replacement,product
ls = [a,b,c,d,e]
comb = list(combinations(ls,2))

flag=0
for i in range(10):
    sa = abs(comb[i][1] - comb[i][0])
    if sa > k:
        flag=1

if flag==0:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
# coding: utf-8
# Your code here!

n = int(input())

a = list(map(int,input().split(" ")))

dai = 0

for i in range(1,n):
    if a[i] < a[i-1]:
        dai += a[i-1] - a[i]
        a[i] = a[i-1]
        
print(dai)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
n=int(input())
al=[chr(ord('a') + i) for i in range(15)]
def dfs(c,i):
    if i==n:
        print(c)
        return
    for k in range(ord(c[-1])-ord('a')+2):
        dfs(c+al[k],i+1)
dfs("a",1)
# Judge status: Accepted
h = int(input())

ans = 1
total = 2
while total<=h:
  ans += total
  total = total * 2

print(ans)
# Judge status: Accepted
kk = list(map(int, input().split()))
a = kk[0] - (kk[0] % kk[1])
b = a / kk[1]

if (kk[0] % kk[1]) == 0:
  answer = b * kk[2]
else:
  answer = (b + 1) * kk[2]
print(int(answer))
# Judge status: Accepted
A, B = map(int, input().split())

ans = ["Alice", "Bob", "Draw"]

if A == 1:
  A = 14
if B == 1:
  B = 14
  
if A > B:
  print(ans[0])
elif A == B:
  print(ans[2])
else:
  print(ans[1])
# Judge status: Wrong Answer
s=input()
a=0
b=0
for i in range(len(s)):
  if s[i]=="1":
    a+=1
  else:
    b+=1
print(min(a,b)*2)
print(a,b)
# Judge status: Accepted
S=input()
K=int(input())
c2i=lambda c: ord(c)-ord("a")
i2c=lambda i: chr(i+ord("a"))
A=list(map(c2i, S))
for i in range(len(A)):
    if A[i] and 26-A[i]<=K:
        K-=26-A[i]
        A[i]=0
A[-1]+=K
A[-1]%=26
print("".join(map(i2c,A)))
# Judge status: Accepted
s = input()

l = list(s)
n = len(s)

dp = [0] * 2019
dp[0] = 1
x = 0

for i in range(n):
    x = ((int(l.pop()) * pow(10, i, 2019)) + x) % 2019
    dp[x] += 1
answer = 0

for i in range(2019):
    answer += dp[i] * (dp[i] - 1) / 2
print(int(answer))
# Judge status: Accepted
N,M,X,Y = map(int, input().split())
x = list(set(map(int, input().split())))
y = list(set(map(int, input().split())))
x.sort(), y.sort()
Z = min(y)

fl = True
for i in range(N):
    if x[i] < Z and (X<Z<=Y):
        continue
    else:
        fl = False
print('No War') if fl else print('War')
# Judge status: Accepted
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0
for i in range(2, N + 1):
    if i in a:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= INF

print(dp[N])
# Judge status: Wrong Answer
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
prod = [math.log(a[0])]*(n+1)
for i in range(n):
	prod[i+1] = prod[i] + math.log(a[i])

for i in range(k+1,n+1):
	if prod[i] - prod[i-k] > prod[i-1] - prod[i-1-k]:
		print('Yes')
	else:
		print('No')
# Judge status: Wrong Answer
def gcd(n,m):
    n,m=sorted([n,m])
    while(m%n!=0):
        n,m=m%n,n
    return n
def lcm(n,m):
    return n*m//gcd(n,m)
n,m=map(int,input().split())
l=list(map(int,input().split()))
t=l[0]//2
for i in l[1:]:
    t=lcm(t,i//2)
print(-(-(m//t)//2))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

G = 0
Z = 0
ans = 1
for i in range(N-1):
  if A[i+1] > A[i]:
    G += 1
  elif A[i+1] < A[i]:
    Z += 1
  if G != 0 and Z != 0:
    ans += 1
    G = 0
    Z = 0
print(ans)
# Judge status: Accepted
import numpy as np

def Speed_Anag_Count(String):
    count = {}
    for i in String:
        i = sorted(i)
        i = str(''.join(i))
        if count.get(i) is None:
            count[i] = 0
        count[i] += 1
    
    return count

N = int(input())

S = [str(input()) for _ in range(N)]

count = Speed_Anag_Count(S)

ans=0
for i in count.values():
    ans += (i*(i-1)/2)
    
print(int(ans))
# Judge status: Accepted
import math
n = int(input())
ans = 0
t = [math.gcd(i, j) for i in range(1, n+1) for j in range(1, n+1)]

for i in t:
    for j in range(1, n+1):
        ans += math.gcd(i, j)

print(ans)
# Judge status: Wrong Answer
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
kingaku=[]
for i in range(M):
    x_input, y_input, c_input = map(int, input().split())
    kingaku.append(a[x_input-1]+b[y_input-1]+c_input)
kingaku.append(min(a)+min(b))

print(min(kingaku))
# Judge status: Accepted
n,d=map(int,input().split());print(sum([d**2>=a**2+b**2 for a,b in [list(map(int,input().split())) for _ in range(n)]]))
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())

res = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if 500 * i + 100 * j + 50 * k == x:
                res += 1

print(res)
# Judge status: Accepted
n, x, y = map(int, input().split())
x -= 1
y -= 1

dists = [0] * (n-1)

for i in range(n):
    for j in range(i+1, n):
        d = min(
            abs(j-i),
            abs(i-x) + abs(y-j) + 1,
            abs(i-y) + abs(x-j) + 1
        )

        dists[d-1] += 1

print(*dists, sep='\n')
# Judge status: Accepted
K,A,B=map(int,input().split())
if A<B:
	if K+2<A:
		print(K+1)
	else:
		T=K-(A-1)
		if T%2==0:
			ans=A+(T//2)*(B-A)
			print(max(ans,K+1))
		else:
			ans=A+(T//2)*(B-A)
			print(max(ans+1,K+1))
else:
	print(K+1)
# Judge status: Wrong Answer
n, q = map(int, input().split())
s = input().rstrip()

pos = []
for i in range(n - 1):
    if s[i] == 'A' and s[i + 1] == 'C':
        pos.append(i)

print(pos)
for i in range(q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1

    ans = 0
    for j in range(len(pos)):
        if l <= pos[j] <= r - 1:
            ans += 1
    print(ans)
# Judge status: Accepted
n = int(input())

for i in range(50):
    for j in range(50):
        if 4*i + 7*j == n:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
def main():
    n = list(input())
    if "7" in n:
        print("Yes")
    else:
        print("No")
    return 

if __name__== "__main__":
    main()
# Judge status: Wrong Answer
a, b= map(int, input().split())
if (a<0)and(b<0):
    print('Negative')
elif (a>0)and(b>0):
    print('Positive')
elif (a==0)or(b==0):
    print('Zero')
else:
    print('Zero')
# Judge status: Wrong Answer
s=input()
q=int(input())
a=[list(map(str,input().split())) for i in range(q)]

ans=[]
ans.append(s)

for i in range(q):
  if len(a[i])==1:
    ans.insert(0,ans[-1])
    ans.append(ans[1])
    ans.pop(1)
    ans.pop(-2)

  else:
    if a[i][1]=='1':
      ans.insert(0,a[i][2])
    else:
      ans.append(a[i][2])

print(''.join(ans))
# Judge status: Accepted
from collections import defaultdict
N = int(input())
a = list(map(int, input().split()))

d = defaultdict(int)
for i in a:
    d[i] += 1

ans = 0
for v, c in d.items():
    if v > c:
        ans += c
    elif v < c:
        ans += c - v

print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
from collections import *
from heapq import *

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

for _ in range(N):
    A, B = map(int, input().split())
    d[A].append(B)

pq = []
ans = 0

for i in range(M, -1, -1):
    for v in d[M-i]:
        heappush(pq, -v)
    
    if len(pq)>0:
        ans += -heappop(pq)

print(ans)
# Judge status: Accepted
a,b,x=map(int,input().split())
if a <= x <= a+b:
	print('YES')
else:
	print('NO')
# Judge status: Wrong Answer
def main():
    N = list(input())
    if len(N) == len(set(N)):
        print("Good")
    else:
        print("Bad")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N=int(input())
X=list(map(int, input().split()))
X.sort()
for i in range(N):
  if i < N//2:
    print(X[ N//2 ])
  else:
    print(X[N//2-1])
# Judge status: Accepted
x,y,z=map(int,input().split())
print(len(range(z+y,x-z+1,z+y)))
# Judge status: Accepted
import math

def f(x, y, z):
  return(x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x)

n = int(input())
fs = [0] * n

lim = math.floor(math.sqrt(n))
rng = range(1, lim)

for x in rng:
  for y in rng:
    for z in rng:
      v = f(x, y, z)
      if v <= n:
      	fs[v - 1] += 1
      
for i in range(n):
  print(fs[i])
# Judge status: Accepted
c=[list(map(int,input().split())) for _ in range(3)]

ans = "Yes"

for i in range(2):
    if c[i+1][1]-c[i+1][0] != c[0][1]-c[0][0]:
        ans = "No"
    if c[i+1][2]-c[i+1][1] != c[0][2]-c[0][1]:
        ans = "No"
for j in range(2):
    if c[1][i+1]-c[0][i+1] != c[1][0]-c[0][0]:
        ans = "No"
    if c[2][i+1]-c[1][i+1] != c[2][0]-c[1][0]:
        ans = "No"

print(ans)
# Judge status: Accepted
from itertools import combinations

# input
L, R = map(int, input().split())

# check
mod0 = [n for n in range(0, R + 1, 2019) if L <= n]
if not mod0:
    target_num = list(range(L, R + 1))
    nC2 = list(combinations(target_num, 2))
    mods_ans = [(i * j) % 2019 for i, j in nC2]

    print(min(mods_ans))
else:
    print(0)
# Judge status: Wrong Answer
A,B = map(int,input().split())
if A > 8 or B > 8:
  print(":)")
else:
  print("Yay!")
# Judge status: Accepted
n,x = map(int, input().split())
a = list(map(int, input().split()))

t = 0
ans = 0
for i in a:
  s = max(0, t+i-x) # 一つ前の値の差分を含めて、xとの差分を取得し、比較
  t = i - s
  ans += s
print(ans)
# Judge status: Accepted
def main():
    n, k = map(int, input().split())
    a, b = [0 for i in range(n)], [0 for i in range(n)]
    for i in range(n):
        a[i], b[i] = [int(x) for x in input().split()]
    ans = solve(n, k, a, b)
    print(ans)


def solve(n, k, a, b):
    ab = [[a[i], b[i]] for i in range(n)]
    ab.sort(key = lambda x:x[0])
    back = 0
    for i in range(n):
        back += ab[i][1]
        if back >= k:
            return ab[i][0]
    return 


if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()
t = s[::-1]
cnt = 0
for i in range(len(s)):
  if s[i] != t[i]:
    cnt += 1
print(cnt // 2)
# Judge status: Wrong Answer
l,r,d = map(int,input().split())

print( (1 + r - l) // d )
# Judge status: Accepted
a, b = map(int, input().split())
if a > 8 or b > 8:
    print(":(")
else:
    print("Yay!")
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

asum = sum(a)
aave = asum // 2

s1 = 0
s2 = 0

i = 0

if N != 2:
    while s1 <= aave and i < N:
        s2 = s1
        s1 += a[i]
        i += 1

    if i == N:
        print(min(abs(s[0: N - 2] - s[N - 1]), abs(s[0] - s[1: N - 1])))
        exit()

    print(min(abs(asum - s1 * 2), abs(asum - s2 * 2)))

else:
    print(abs(a[0] - a[1]))
# Judge status: Accepted
import sys
# sys.stdin = open('input.txt')

n = input()
if n.__contains__('7'):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()
for i in range(len(s)):
	if i%2 == 0 and s[i] not in ["R","U","D"]:
		print("No")
		exit()
	elif i%2 == 1 and s[i] not in ["L","U","D"]:
		print("No")
		exit()
print("Yes")
# 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,j=0,M
for i in range(N+1):
  if a[i]>K:
    break
  while b[j]>K-a[i]:
    j-=1
  ans=max(ans,i+j)
print(ans)
# Judge status: Accepted
# solution
import io

data = int(input())

array = set()
for _ in range(data):
    ai = int(input())
    if ai in array:
        array.remove(ai)
    else:
        array.add(ai)
print(len(array))
# Judge status: Accepted
import numpy as np

K,N = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = []
maxdist = 0
for i in range(N-1):
    B.append(A[i+1]-A[i])
    if B[-1]>maxdist:
        maxdist = B[-1]

if A[0]+K-A[-1]>maxdist:
    maxdist = A[0]+K-A[-1]

print(K - maxdist)
# Judge status: Accepted
import math
import sys
import itertools
from math import gcd
from math import sqrt
from sys import stdin
def input() : return stdin.readline().rstrip()
def mips():
    return map(int,input().split())
def ii():
    return int(input())
sys.setrecursionlimit(10**9)

N = ii()
A = [i for i in mips()]
ans = 0
for i in range(N-1):
    if A[i] > A[i+1]:
        ans += abs(A[i]-A[i+1])
        A[i+1] = A[i]
print(ans)
# Judge status: Wrong Answer
from sys import stdin
input = stdin.readline
s = int(input())

N=s+s*s+s*s*s

print (type(N), N)
# Judge status: Accepted
s = input()
print('A{}C'.format(s[8]))
# Judge status: Accepted
from collections import defaultdict as dd
d = dd(list)

n, m = map(int, input().split())
h = list(map(int, input().split()))
for i in range(m):
    a, b = map(int, input().split())
    d[a].append(b)
    d[b].append(a)

ans = []
for i in range(n):
    flg = True
    for nb in d[i+1]:
        if h[i] <= h[nb-1]:
            flg = False
    if flg or len(d[i+1]) == 0:
        ans.append(i+1)

print(len(ans))
# Judge status: Accepted
import collections
n = int(input())
l = []
for i in range(n):
    l.append(input())
c = collections.Counter(l)
print(len(c))
# Judge status: Wrong Answer
N = int(input())
W = list(map(int, input().split()))

half = sum(W) / 2
first_half = 0

for i in range(N):
    first_half += W[i]
    mid_index = i
    if first_half >= half:
        break

second_half = sum(W[i+1:])

print(abs(first_half - second_half))
# Judge status: Wrong Answer
n = int(input())
s = input().replace("()", "X").replace("(", "(S").split("S")

ans = ""
for q in s:
    ans += q.count(")") * "(" + q
ans += ")" * len(ans[ans.rfind(")") + 1:])
print(ans.replace("X", "()"))
# Judge status: Wrong Answer
n = int(input())
lst1 = list(map(int,input().split()))
s = sum(lst1)
abs_ = 10**9
now = 0
i = 0
while True:
    now += lst1[i]
    if i >= n-1:
        break
    else:
        abs_ = min(abs_,abs(now-(s-now)))
    i += 1

print(abs_)
# Judge status: Accepted
N,M=map(int,input().split())
A=[[] for _ in range(N+1)]
for _ in range(M):
    a,b=map(int,input().split())
    A[a].append(b)

ans=False
for i in A[1]:
    if i==N:
        ans=True
        break
    for j in A[i]:
        if j==N:
            ans=True
            break
print("POSSIBLE" if ans else "IMPOSSIBLE" )
# Judge status: Wrong Answer
print(chr(ord(input("input:")) + 1))
# Judge status: Accepted
n=int(input())
l=[]
for i in range(n):
    a,b=map(int,input().split())
    l.append([b,a])
l.sort()
time=0
cnt=0
for i in range(n):
    time+=l[i][1]
    if time>l[i][0]:
        print("No")
        break
    else:
        cnt+=1
if cnt==n:
    print("Yes")
# Judge status: Accepted
n = int(input())
c = str(input())

a, b = 0, 0

a = c.count('R')
ans = max(a, b)

for i in range(n):
    if c[i] == 'R':
        a -= 1
    else:
        b += 1
    ans = min(ans, max(a, b))
print(ans)
# Judge status: Wrong Answer
N=list(input())
ans=0
for x in N:
  x=int(x)
  if x%2==1:
    ans+=1
  ans+=(x//2)*2
print(ans)
# Judge status: Accepted
X, Y, Z = map(int, input().split())
for i in range(100000):
    if X / (i* Y + (i + 1) * Z) >= 1:
        pass
    else:
        print(i - 1)
        break
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
ans=0
for i in range(1,n):
  ans+=a[i//2]
print(ans)
# Judge status: Wrong Answer
l=[]
f=0
for i in range(5):
    z=int(input())
    l.append(z)
k=int(input())
for i in range(4):
    for j in range(1,5):
        if l[j]-l[i]>=k:
            f=1
            break
if f==1:
    print(":(")
else:
    print("Yay!")
# Judge status: Wrong Answer
n = int(input())
h = list(map(int,input().split()))
dp = [10**4] * (n+1)
dp[0] = 0
dp[1] = abs(h[1]-h[0])
for i in range(2,n):
    dp[i] = min(dp[i-2] + abs(h[i-2] - h[i]), dp[i-1] + abs(h[i-1] - h[i]))
print(dp)
print(dp[n-1])
# Judge status: Accepted
n = int(input())
a, b = [], []
for _ in range(n):
    x, y = map(int, input().split())
    a.append(x+y)
    b.append(x-y)
 
a.sort()
b.sort()
 
ans = max(a[-1]-a[0], b[-1]-b[0])
print(ans)
# Judge status: Accepted
n = int(input())
a = n//500
b = (n%500)//5
print(a*1000 + b*5)
# Judge status: Accepted
h = int(input())

def attack(a):
    if a >1:
        return 2 * attack(a//2) +1
    elif a == 1:
        return 1
print(attack(h))
# Judge status: Accepted
import math

h = int(input())
atk = 0
enemy = 1

while True:
    if h > 1:
        h = math.floor(int(h/2))
        atk += enemy
        enemy *= 2
    elif h == 1:
        atk += enemy
        break

print(atk)