peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
ans = 0
m = 0
if n==1:
    print(1)
else:
    for i in range(2,n+1,2):
        a = 0
        x = i
        while(True):
            if x%2!=0:
                break
            a+=1
            x = x//2
        if a>m:
            m=a
            ans=i
    print(ans)
# Judge status: Accepted
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce

n = int(input())
x = list(map(int, input().split()))
y = sorted(x)
a = y[n // 2 - 1]
b = y[n // 2]
# print("a =", a)
# print("b =", b)
for i in x:
    if i <= a:
        print(b)
    else:
        print(a)
# Judge status: Accepted
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)
# Judge status: Wrong Answer
def calc_half(n):
    return n / 2

def calc_rem(n):
    return n % 2

N = input()

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

n = 0
while list(map(calc_rem, A)) == [0, 0, 0]:
    A = map(calc_half, A)
    n += 1
print(n)
# Judge status: Wrong Answer
S = input()
T = input()

T = T.replace(S,"")
print(T)
if len(T) == 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

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

print(max(a*c, a*d, b*c, b*d))
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
l.sort()
s = 0
for i in range(n-1):
    s += l[i]
if s > l[-1]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,m=map(int,input().split())
ab,cd=[],[]
ans_dis=[1000000000 for i in range(n)] 
ans=[0 for i in range(n)]
for i in range(n):
    a,b=map(int,input().split())
    ab.append([a,b])
for i in range(m):
    c,d=map(int,input().split())
    cd.append([c,d])
for i in range(n):
    for j in range(m):
        dis=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if dis<ans_dis[i]:
            ans[i]=(j+1)
            ans_dis[i]=dis
for i in range(n):
    print(ans[i])
# Judge status: Accepted
s = input()
if s == 'ABC':
    print('ARC')
else:
    print('ABC')
# Judge status: Accepted
S=input()
T=input()
if S==T[:-1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
f=1
for i in range(1,n+1):
    f*=i
print(f)
# Judge status: Accepted
import sys
from math import gcd
from functools import reduce

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


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

    print(reduce(gcd, A))
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = [int(a) for a in input().split()]
import fractions
mod = 10**9+7

t = 1
for a in A:
    t = a*t//fractions.gcd(a, t)

ans = 0
for a in A:
    ans += t//a

print(ans%mod)
# Judge status: Accepted
a,b=map(int,input().split())
if a==b:print(a*2)
else:print(max(a,b)*2-1)
# Judge status: Accepted
S = input()
AA = int(S[:2]) 
BB = int(S[2:])
if (1 <= AA <= 12) and (1 <= BB <= 12):
    print('AMBIGUOUS')
elif (13 <= AA or AA == 0) and (1 <= BB <= 12):
    print('YYMM')
elif (1 <= AA <= 12) and (13 <= BB or BB == 0):
    print('MMYY')
else:
    print('NA')
# Judge status: Accepted
n=int(input())
tens=[]
for i in range(n):
    x,y=map(int,input().split())
    tens.append([x,y])

tasu=[]
hiku=[]

for i in range(n):
    tasu.append(tens[i][0]+tens[i][1])
    hiku.append(tens[i][0]-tens[i][1])

#print(tasu,hiku)

a=max(tasu)-min(tasu)
b=max(hiku)-min(hiku)

print(max(a,b))
# Judge status: Wrong Answer
n=int(input())
a=list(map(int, input().split()))
x = 0
y = 0
for i in a:
    if i %2 != 0:
        x+=1
    elif i%4 == 0:
        y+=1
if y >=x:
    print('Yes')
else:
    if x+y == len(a):
        if y == x-1:
            print('Yes')
print('No')
# Judge status: Accepted
N, Q = map(int, input().split())
S = input()
A = [0, 0]

for i in range(1, N):
	if S[i - 1] == 'A' and S[i] == 'C':
		A.append(A[i] + 1)
	else:
		A.append(A[i])
		
for i in range(Q):
	l, r = map(int, input().split())
	print(A[r] - A[l])
# Judge status: Accepted
import math
import numpy as np

L = int(input())
a0 = L/3

print(a0*a0*a0)
# Judge status: Accepted
n = int(input())
s = input()

s_list = []

for item in s:
    if item == '.':
        s_list.append(0)
    else:
        s_list.append(1)

min_val = s_list.count(0)

left_val = 0
right_val = s_list.count(0)

for i in range(len(s_list)):
    if s_list[i] == 0:
        right_val -= 1
        min_val = min(left_val + right_val, min_val)
    else:
        left_val += 1

print(min_val)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
if N == 1:
  print(0)
  exit(0)
mod = 10 ** 9 + 7
res = pow(10, N, mod) - pow(9, N, mod) * 2 + pow(8, N, mod)
print(res % mod)
# Judge status: Accepted
#A - Fairness
A,B,C,K = map(int, input().split())

if K % 2 == 0:
    ans = A - B
else:
    ans = B - A

if abs(ans) >= 10**18:
    print("Unfair")
else:
    print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())

if c - b - a <= 0:
    print("No")
elif 4*a*b < (c-b-a)**2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys

input = sys.stdin.readline

def main():
    N = int(input())
    A = []
    for _ in range(N):
        A.append(int(input()))
    first = max(A)
    idx = A.index(first)
    second = max(A[:idx]+A[idx+1:])
    for i in range(N):
        if i == idx:
            print(second)
        else:
            print(first)

if __name__ == "__main__":
    main()
# Judge status: Accepted
input_line = input()

if input_line.isupper() == True:
  print("A")
else:
  print("a")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A_guu = [i for i in A if i % 2 == 0]
A_ans = [i for i in A_guu if i % 3 == 0 or i % 5 == 0]
# print(A_guu)
# print(A_ans)
if A_ans == A_guu:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Accepted
from collections import Counter

MOD = 10**9 + 7

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

c = Counter(S)

ans = 1
for k in c.keys():
    ans *= c[k]+1
    ans %= MOD

ans -= 1

print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
print(M*(M-1)//2+N*(N-1)//2)
# Judge status: Wrong Answer
s = input()
n = len(s)
ans = 1
kar = s[0]
for i in range(n-1):
    if kar == s[i+1]:
        kar = kar + s[i+1]
    elif kar != s[i+1]:
        kar = s[i+1]
        ans += 1
        
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())

for i in range(1, b + 1):
    if (a * i) % b == c:
        print("YES")
        exit()
print("NO")
# Judge status: Accepted
def resolve():
	n = int(input())
	print(n*(n+1)//2)

resolve()
# Judge status: Accepted
N,M,Q=map(int, input().split())
X=[list(map(int, input().split())) for i in range(Q)]
import itertools
a=[]
for i in range(1,M+1):
  a.append(i)
A=list(itertools.combinations_with_replacement(a,N))
ans=0
for i in range(len(A)):
  K=A[i]
  p=0
  for a,b,c,d in X:
    if K[b-1]-K[a-1]==c:
      p+=d
  ans=max(p,ans)
print(ans)
# Judge status: Wrong Answer
x = int(input())
 
ans = x
 
while True:
  for i in range(2, ans):
    if ans % i == 0:
      continue
  else:
    print(ans)
    exit()
  ans += 1
# Judge status: Accepted
N = int(input())
s = ["".join(sorted(input())) for i in range(N)]
D = dict()
for st in s:
    if st in D:
        D[st] += 1
    else:
        D[st] = 1
ans = 0
for i in D:
    k = D[i]
    ans += (k*(k-1))//2
print(ans)
# Judge status: Accepted
n=int(input())
if n==3 or n==5 or n==7:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n=int(input())
Ai=[int(i) for i in input().split()]
Bi=[]
for i in range(n):
    Bi.append(Ai[i]-(i+1))
Bi.sort()
b=Bi[n//2]
ans=0
for i in range(n):
    ans+=abs(Bi[i]-b)
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
hs=sorted([int(input()) for _ in range(n)])
m=float('inf')
for l,h in zip(hs,hs[k-1:]):
    m=min(m,h-l)
print(m)
# Judge status: Accepted
a, b, c = map(int,input().split())
print(min(abs(a*b*((c-c//2)-c//2)), abs(a*c*((b-b//2)-b//2)), abs(c*b*((a-a//2)-a//2))))
# Judge status: Wrong Answer
def find_max_rectangle(pair):
  """
  Args:
    pair (list)
  Returns:
    area (int)
  """
  if pair:
    M = max(pair)
    second_max = -1
    for num in pair:
      if num != M and second_max < num:
        second_max = num
    return M * second_max
  else:
    return 0



n = int(input())
L = list(map(int, input().split()))
L.sort()
pair = []
prev = None
while L:
  popped = L.pop()
  if prev == popped:
    pair.append(prev)
    prev = None
  else:
    prev = popped

print(find_max_rectangle(pair))
# Judge status: Accepted
N = int(input())
tmp = []
if(N == 0):
  print('0')
else:
  while(abs(N)!=0):
    tmp.append(N%2)
    N = (N - N % 2) // -2
tmp.reverse()
print(''.join([str(n) for n in tmp]))
# Judge status: Wrong Answer
str1 = input()
asc = ord(str1) + 1
print(asc)
ans = chr(asc)
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

b4=0
b2=0
b1=0
for i in range(n):
    if a[i]%4==0:
        b4+=1
    elif a[i]%2==0:
        b2+=1
    else:
        b1+=1
        
if b2==0:
    if b1<=b4+1:
        print("Yes")
    else:
        print("No")
else:
    if b1<=b4:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a == 0:
    if b == 100:
        print(b + 1)
    else:
        print(b)

else:
    cand = 100 **a
    if b == 100**2 or 100**3:
        print(cand * b + 1)
    else:
        print(cand * b)
# Judge status: Accepted
n = int(input())
s = [int(i) for i in input().split()]
s.sort()
flag = False
for i in range (0,n-1):
  if s[i] == s[i+1]:
    flag = True
    break
if flag == True:
  print("NO")
else: print("YES")
# Judge status: Wrong Answer
a = input()
b = a.split(" ")
x, y = int(b[0]), int(b[1])
if x * 2 <= y <= x * 4:
    print("yes")
else:
    print("no")
# Judge status: Wrong Answer
x=list(map(int,input().split()))
x.sort()
if (x[0]==x[1])or(x[1]==x[2]):
    print(2)
elif x[0] == x[1] == x[2]:
    print(1)
else:
    print(3)
# Judge status: Accepted
#!/usr/bin/env python3

N,M = map(int,input().split())
lst = [i+1 for i in range(M)]


for _ in range(N):
    tmp = list(map(int,input().split()))
    K = tmp[0]
    A = tmp[1:]
    lst = list(filter(lambda x: x in A,lst))

print(len(lst))
# Judge status: Accepted
L, R = map(int, input().split())
if R - L >= 2019:
    mn = 0
else:
    l, r = L % 2019, R % 2019
    mn = 2018 ** 2
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            mn = min(mn, i * j % 2019)
print(mn)
# Judge status: Accepted
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S.sort()
print(''.join(S))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a*b%2==0:
  print("Even")
else:
  print("odd")
# Judge status: Wrong Answer
import collections

N, M = map(int, input().split())
graph = [[] for _ in range(N)]
t = [10**18] * N
last = [-1] * N 
for _ in range(M):
  A, B = map(int, input().split())
  A -= 1
  B -= 1
  graph[A].append(B)
  graph[B].append(A)

q = collections.deque([[0, 0]])
count = 0
while q:
  tmp = q.pop()
  pos, time = tmp[0], tmp[1]
  for next_pos in graph[pos]:
    if time+1 < t[next_pos]:
      last[next_pos] = pos
      t[next_pos] = time+1
      q.append([next_pos, time])
print('Yes')
for n in last[1:]:
  print(n+1)
# Judge status: Accepted
import heapq
n = int(raw_input())
heap = [map(int, raw_input().split(' '))[::-1] for _ in range(n)]
heapq.heapify(heap)
#(deadline, duration)
def f(heap):
	t = 0
	while(heap):
		nd,d = heapq.heappop(heap)
		gap = nd - t 
		gap -= d
		t += d
		while(heap and heap[0][0] == nd):
			_,v = heapq.heappop(heap) 
			t += v
			gap -= v
		if gap < 0: return False
	return True
print 'Yes' if f(heap) else 'No'
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split())) 

A.sort()
counter = 0
print(A)
for i in A:
  print('i:'+str(i))
  second = [m for m in A if i < m]
  for j in second:
    print('j:'+str(j))
    third = [n for n in second if j < n]
    if len(third) > 0:
      for k in third:
      	counter += 1
      	print(i,j,third[0])
print(counter)
# Judge status: Accepted
L = list(map(int,input().split()))
K = int(input())
print(sum(L) - max(L) + max(L) * 2 ** K)
# Judge status: Wrong Answer
num_list = list(map(int, input().split()))

if num_list.count(5) == 2 and num_list.count(7) == 1:
    print("Yes")

else:
    print("No")
# Judge status: Wrong Answer
a, b, c = list(map(int, input().split()))
l = a + b + 2 * ((a*b)**(1/2))
r = c
if l < r:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n, p = map(int, input().split())
A = list(map(int, input().split()))
if n>=2:
    print(pow(2, n)//2)
else:
    print(1 if A[0]%2==p else 0)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans = 0

if sum(A)%N == 0:
    x = sum(A)//N
    for i in range(N):
        ans += (x-A[i])**2
    print(ans)
else:
    x = sum(A)//N
    b = sum(A)//N+1
    if sum(A)/N - x > b - sum(A)/N:
        x = b
    for i in range(N):
        ans += (x-A[i])**2
    
    print(ans)
# Judge status: Wrong Answer
t= ["Sunny", "Cloudy", "Rainy"]
print(t[t.index(input())])
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
a,b = map(int, input().split())

if a >= 1 and a <= 9 and b >= 1 and b <= 9:
  print(a*b)
else:
  print(-1)
# Judge status: Accepted
import math
import copy

neko = 0
nuko = 0
n = int(input())
a = [0] * 100
a[0] = 2
a[1] = 1
for i in range(2,n+1):
    a[i] = a[i-1] + a[i-2]
print(a[n])
# Judge status: Wrong Answer
s=input()
if s.islower()==True:
  print(s.upper())
else:
  print(s.lower())
# Judge status: Accepted
def LIS(A):
    dp = [-A[0]]
    for a in A[1:]:
        if -a >= dp[-1]:
            dp.append(-a)
        else:
            dp[bisect_right(dp, -a)] = -a
    return len(dp)

##################################################################################################################

import sys
input = sys.stdin.readline
from bisect import bisect_right

N = int(input())
A = list(map(int, sys.stdin.readlines()))

print(LIS(A))
# Judge status: Wrong Answer
import numpy as np


def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    k = max(a).bit_length()
    c = np.zeros(n, dtype=np.int)
    for i in range(k):
        b = np.array([ai // 2**i % 2 for ai in a], dtype=np.int)
        if b.sum() % 2:
            b = 1 - b
        print(b)
        c += b * 2**i
    print(*c)


if __name__ == '__main__':
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")

N,M = [int(x) for x in stdin.readline().rstrip().split()]

hyo = list(map(int,[int(x) for x in stdin.readline().rstrip().split()]))
sort_hyo = sorted(hyo, reverse=True)
point = sum(hyo)
target = math.ceil(point / (4*M))
for i in range(len(hyo)):
    if sort_hyo[i] >= target:
        sort_hyo[i] = "Yes"
    else:
        sort_hyo[i] = "No"
        
print(sort_hyo[M-1])
# Judge status: Accepted
s = input()
t = input()
if s == t[:-1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = sorted(list(map(int,input().split())),reverse=True)
A = sum(a[::2])
B = sum(a[::2])
print(A - B)
# Judge status: Accepted
import itertools


def triple(iterable):
    a, b, c = itertools.tee(iterable, 3)
    next(b, None), next(c, None), next(c, None)
    return zip(a, b, c)


n = int(input())
P = list(map(int, input().split()))

ans = 0
for x, y, z in triple(P):
    sorted_tuple = sorted([x, y, z])
    if sorted_tuple[1] == y:
        ans += 1
print(ans)
# Judge status: Accepted
A = input()
if A.islower():
    print('a')
else:
    print('A')
# Judge status: Accepted
N = int(input())
INF = 10 ** 6
dp = [INF] * (N + 1)

MONEY = []
i = 1
while i <= N:
    MONEY.append(i)
    i *= 6
i = 1
while i <= N:
    MONEY.append(i)
    i *= 9

MONEY.sort()
# print(MONEY)

for init in MONEY:
    dp[init] = 1


for i in range(1, N + 1):
    for plus in MONEY:
        if i + plus <= N:
            dp[i + plus] = min(dp[i] + 1, dp[i + plus])
# print(dp)
print(dp[N])
# Judge status: Wrong Answer
import math

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

ans = 0
for i in range(n - 1):
    sm = 0
    for j in range(i, n - 1):
        c = cL[j]
        s = sL[j]
        f = fL[j]
        if sm < s:
            sm = s
        sm += c + (f - ((sm - s) % f) % f)
    print(sm)
print(0)
# Judge status: Accepted
if __name__ == '__main__':
    s = list(input())
    ans = [0] * (len(s) + 1)
    for i in range(len(s)):
        if s[i] == "<":
            ans[i + 1] += ans[i] + 1
    for i in range(len(s) - 1, -1, -1):
        if s[i] == ">":
            ans[i] = max(ans[i], ans[i + 1] + 1)
    print(sum(ans))
# Judge status: Accepted
K,X= map(int,input().split())

if 500 * K >= X:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
import re
S = input()
array_S = list(S)

if not ( 4 <= len(S) <= 10 ):
    print('WA')
    sys.exit()
if len(re.findall('[A-Z]',S)) != 2:
    print('WA')
    sys.exit()

result = 0
if array_S[0] != 'A': result += 1
if array_S[2:-1].count('C') != 1: result += 1 
array_S.pop(0)
array_S.pop(array_S.index('C'))
if not "".join(array_S).islower(): result += 1 
print('WA') if result != 0 else print('AC')
# Judge status: Accepted
from itertools import permutations
import math
n = int(input())
x,y = [],[]
for _ in range(n):
    x_, y_ =map(int,input().split())
    x.append(x_)
    y.append(y_)
c = list(permutations([i for i in range(1,n+1)],n))
sum = 0
for ci in (c):
    tmp = 0
    for i in range(len(ci)-1):
            tmp += math.sqrt((x[ci[i]-1]-x[ci[i+1]-1])**2 
                             + (y[ci[i]-1]-y[ci[i+1]-1])**2)
    sum += tmp
print(sum/len(c))
# Judge status: Accepted
X, Y = map(int, input().split())

def comb(n, k, mod=10**9+7):
    ret = 1
    for i in range(1, k + 1):
        ret = ret * (n - i + 1) % mod
        ret = ret * pow(i, mod - 2, mod) % mod
    return ret

a = (2 * Y - X) / 3
b = (2 * X - Y) / 3
if a != int(a) or b != int(b) or a < 0 or b < 0:
    print(0)
else:
    print(comb(int(a + b), int(a)))
# Judge status: Accepted
n, m = map(int, input().split())
Authority = [list(map(int, input().split())) for _ in range(m)]
cards = list(range(1, n + 2))
l_list = []
r_list = []
for i in range(m):
    l_list.append(Authority[i][0])
    r_list.append(Authority[i][1])
        
print(len(cards[max(l_list):min(r_list) + 1]))
# Judge status: Accepted
W,a,b=map(int,input().split())
Max=max(a,b)
Min=min(a,b)

ans=Max-(Min+W)
if ans<0:
    ans=0
print(ans)
# Judge status: Accepted
child=int(input())
ame=0

while child!=0:
    ame=ame+child
    child-=1

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

if N%2 != 0:
    print("No")
else:
    n = N//2
    if S[:n]==S[n:]:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
n = int(input())
h = list(map(int,input().split(" ")))

plsl = []
plsn = 0
for i in range(n-1):
    if h[i]>= h[i+1] and i == n-2:
        plsn += 1
        # print(plsn)
        plsl.append(plsn)
        # print(plsl)
    elif h[i]>= h[i+1] and i < n-2:
        plsn += 1
        # print(plsn)
    else:
        plsl.append(plsn)
        # print(plsl)
        plsn = 0
        # print(plsn)
plsl.sort(reverse = True)
print(plsl[0])
# Judge status: Accepted

if __name__ == '__main__':
    S=list(input())
    K=int(input())
    S=[int(s) for s in S]
    for i in range(K):
        if S[i]!=1:
            print(S[i])
            break
        else:
            if i==K-1:
                print(1)
# Judge status: Accepted
n,m=map(int,input().split())
if n%2==1:
    x=""
    for i in range(m):
        x+=f"{i+1} {n-i}\n"
    print(x)
else:
    x=""
    for i in range(m):
        x+=(f"{i+1} {n-i}\n" if i<m/2 else f"{i+1} {n-i-1}\n")
    print(x)
# Judge status: Accepted
N,M= map(int,input().split())
N,M = max(N,M),min(N,M)
mod = 10**9+7

n = 100010
frac = [1]*(n+1)
for i in range(n):
    frac[i+1] = (i+1)*frac[i]%mod
if N==M+1:
    print(frac[N]*frac[M]%mod)
elif N==M:
    print(frac[N]*frac[M]*2%mod)
else:
    print(0)
# Judge status: Wrong Answer
from collections import defaultdict
N, M = map(int,input().split())
A = list(map(int,input().split()))
T = []
for _ in range(M):
  a, b = map(int,input().split()) 
  T+=[b]*a
A.sort()
T.sort(reverse = True)
# Judge status: Accepted
A,B,C = map(int, input().split())
D = C-(A-B)
if D < 0:
    print(0)
else:
    print(D)
# Judge status: Accepted
s = input()
ans = 'WA'

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        index = s[2:-1].find('C') + 2
        if s[1:index].islower() and s[index + 1:].islower():
            ans = 'AC'
print(ans)
# Judge status: Accepted
a, b = map(int,input().split())
if a > b:
    print(a*2 - 1)
    
elif a == b:
    print(a + b)
    
elif a < b:
    print(b*2 - 1)
# Judge status: Accepted
S=input().strip()
T=input().strip()
ls = len(S)
lt = len(T)

x = lt
for i in range(0,ls-lt+1):
    m = 0
    for j in range(lt):
        if T[j] != S[i+j]:
            m += 1
    x = min(x,m)

print(x)
# Judge status: Wrong Answer
n=int(input())
A=list(map(int,input().split()))
a=0
ans=1
if 0 in A:
    ans=0
else:
    for a in range(n):
        ans*=A[a]
        a+=1
        if ans<=10**18:
            continue
        else:
            break
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    ans = 0
    for i in range(1,n+1):
        if i % 3 != 0 and i % 5 != 0:
            ans += i
    print(ans)
if __name__=='__main__':
    main()
# Judge status: Wrong Answer
def calcBoundCount(rangex, lstL):
    d = 0
    for i in range(0, len(lstL)):
        d = d + lstL[i]
        if rangex < d:
            return i + 1
    return len(lstL)

N, X = map(int, input().split())
lstL = list(map(int, input().split()))

count = calcBoundCount(X, lstL)
print((count if count <= N+1 else N+1))
# Judge status: Accepted
H=int(input())
W=int(input())
N=int(input())
T=max(H,W)
if N%T==0:
  print(N//T)
else:
  print(N//T+1)
# Judge status: Accepted
print("A" if input().isupper() is True else "a")
# Judge status: Wrong Answer
import math
A,B,N= map(int,input().split())
x=[]
AB=A/B
if N<B:
    #x.append(math.floor(AB*N-1)-A*(N//B)
    print(math.floor(AB*N))
else:
    print(math.floor(AB*B-1))
#for i in range(1,N+1):
# Judge status: Accepted
N, K = map(int, input().split())
Hs = map(int,input().split())
print(sum(sorted(Hs, reverse=True)[K::]))
# Judge status: Accepted
S = input()

if len(S) == len(set([s for s in S])):
  print('yes')
else:
  print('no')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
a,b=map(int,input().split())
print(-((a+b)//2))
# Judge status: Accepted
n,q=map(int, input().split())
s=input()
cnt=[0]*(n-1)
for i in range(n-1):
  if s[i:i+2]=='AC':
    cnt[i]=1
cnt2=[0]*(n)
for i in range(1,n):
  cnt2[i]=cnt2[i-1]+cnt[i-1]
for i in range(q):
  l,r=map(int, input().split())
  print(cnt2[r-1]-cnt2[l-1])
# Judge status: Accepted
a, b = map(int, input().split())

print(int((a+b)/2+0.5))
# Judge status: Accepted
s = sorted(input())
print("Yes" if s==["a", "b", "c"] else "No")
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B = map(int, readline().split())
    A, B = min(A, B), max(A, B)

    if (B - A) % 2 == 1:
        print("IMPOSSIBLE")
    else:
        print((A + B) // 2)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = input()
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in s:
  if i in alpha:
    alpha = alpha.strip(i)
if alpha == '':
  print('None')
else:
  print(alpha[0])
# Judge status: Wrong Answer
N,X=map(int,input().split())
A=list(map(int,input().split()))

if N==2:
    print(max(0,A[0]+A[1]-X))
    exit()

M=0
for i in range(N-1):
    M+=max(A[i]+A[i+1]-X,0)

alpha=max(A[0]-X,0)
beta=max(A[-1]-X,0)
print((M+alpha+beta+1)//2)
# Judge status: Accepted
from itertools import *

def main():
    N, M = list(map(int, input().split()))
    print(len(list(combinations(range(N), 2))) + len(list(combinations(range(M), 2))))

if __name__ == '__main__':
    main()