peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
words = []
for i in range(N):
  s_in = str(input())
  s_sort = ''.join(sorted([ch for ch in s_in]))
  words.append(s_sort)
#print(words)

# Counterクラス: key=要素, val=出現回数
from collections import Counter
cntr = Counter(words)
#print(cntr)

# 出現回数2個以上は組み合わせ数を足す
ans = 0
for cnt in cntr.values():
  if cnt > 1:
    ans += cnt * (cnt - 1) // 2

print(ans)
# Judge status: Wrong Answer
import fractions
a,b=list(map(int,input().split()))

def f(a,b):
  max=fractions.gcd(a,b)
  re=[1,max]
  for i in range(2,max):
    if a%i==0 and b%i==0:re.append(i)
  return re

def g(n):
  if n==0:return False
  for i in range(2,n):
    if n%i==0:return False
  else:return True

ans=[g(n) for n in f(a,b)]
print(ans.count(True))
# Judge status: Accepted
import math
import fractions
def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)
  
def main():
  mod = 10**9 +7
  n = int(input())
  ls = list(map(int,input().split()))
  
  t = ls[0]
  for a in ls:
    t = lcm(t,a)
  
  ans = 0
  for a in ls:
    ans += t//a
  print(ans%mod)
  
if __name__ == '__main__':
  main()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

cnt = [0]*(10**6+1)

for elem in a:
    cnt[elem] += 1

unique = []
for i in range(10**6+1):
    if cnt[i] == 1:
        unique.append(i)

cnt = [0]*(10**6+1)
a = list(set(a))

for elem in a:
    for m in range(elem*2,10**6+1,elem):
        cnt[m] = 1

ans = 0
for elem in unique:
    if cnt[elem] == 0:
        ans += 1

print(ans)
# Judge status: Accepted
from sys import exit

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
n = int(input())

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

if 'S' in S and 'N' not in S:
    print('No')
elif 'N' in S and 'S' not in S:
    print('No')
elif 'E' in S and 'W' not in S:
    print('No')
elif 'W' in S and 'E' not in S:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
tmp = K
time = 1
while(tmp<N):
    tmp += K-1
    time += 1
print(time)
# Judge status: Accepted
n,m = map(int, input().split())
if n >= m//2:
  print(min(n,m//2))
else:
  print(n + (m - 2*n)//4)
# Judge status: Accepted
_,*l=map(int,open(0))
s=b=0
m=100
for i in l:
  s+=i
  if i%10: b=1; m=min(m,i)
print((s-m*(s%10<1))*b)
# Judge status: Accepted
N, R = map(int, input().split())
if N >= 10:
    print(R)
else:
    print(R + 100*(10-N))
# Judge status: Accepted
n,m = map(int,input().split())
r = min(n, m//2)
m -= r*2
if m <= 3:
    pass
else:
    r += m//4


print(r)
# Judge status: Accepted
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

s = input()

print(len(s)-s[::-1].index("Z")-s.index("A"))
# Judge status: Accepted
a,b,x=map(int,input().split())
if x>=a and x<=a+b:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
x, y = map(int, input().split())
m = (-x+2*y)//3
n = (2*x-y)//3
mod = 10**9+7

def c(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(i+1)%mod
    return p * pow(q, mod-2,mod)%mod

if (x+y)%3 !=0 or m*n < 0:
    print(0)
else:
    print(c(m+n,n))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort()
A = A[::-1]
# print(A)

cnt = 1
length = []
for i in range(1, N):
    if A[i] == A[i-1]:
        cnt += 1
        if cnt >= 2:
            length.append(A[i])
            cnt = 0
            if len(length) >= 2:
                break
    elif cnt == 0:
        cnt = 1
else:
    length = [0, 0]
print(length[0] * length[1])
# Judge status: Accepted
S = input()
while True:
    if '0B' in S or '1B' in S:
        S = S.replace('0B','').replace('1B','')
    else:
        S = S.replace('B','')
        break
print(S)
# Judge status: Accepted
n,a,b = [int(x) for x in input().split()]

if a > b:
    print(0)
elif n == 1:
    if a != b:
        print(0)
    else:
        print(1)
else:
    print((b-a)*(n-2)+1)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
    print('Yes')
elif abs(a-b)<=d and abs(b-c):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = int(input())
MAX_V = 10 ** 9
X3 = -S % MAX_V
Y3 = (S + X3) // MAX_V
print(0, 0, MAX_V, 1, X3, Y3)
# Judge status: Accepted
from fractions import gcd
def lcm(x,y):
    return (x * y) // gcd(x,y)

A,B,C,D = map(int,input().split())

cnt = 0
cnt += ((B // C) - ((A-1) // C))
cnt += ((B // D) - ((A-1) // D))

tmp = ((B//lcm(C,D)) - ((A-1)//lcm(C,D)))

ans = B-A+1-cnt+tmp
print(ans)
# Judge status: Accepted
w,h,x,y = map(int,input().split())

if w/2 == x and h/2 == y:
    print(w*h/2,end=' ')
    print(1)
else:
    print(w*h/2,end=' ')
    print(0)
# Judge status: Wrong Answer
n = int(input())

c = 0

for _ in range(n):
    d, e = map(int,input().split())
    if d == e:
        c += 1

if c >= 3 :
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
S = input()
print(len(S))
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    print("Bad")
    exit()
print("Good")
# Judge status: Accepted
N = int(input())
items = []

for i in range(N):
  item = list(input().split())
  item[1] = abs(100 - int(item[1]))
  item.append(i+1)
  items.append(item)

items = sorted(items)

for i in items:
  print(i[2])
# Judge status: Accepted
import itertools
import math
n=int(input())
lis=[list(map(int,input().split())) for i in range(n)]
num=[j for j in range(n)]
new=list(itertools.permutations(num))
ans=0
for i in range(len(new)):
    for j in range(n-1):
        a=new[i][j]
        b=new[i][j+1]
        
        ans+=math.sqrt((lis[a][0]-lis[b][0])**2+(lis[a][1]-lis[b][1])**2)
        
print(ans/len(new))
# Judge status: Wrong Answer
A,B,C,K = map(int,input().split())

for i in range(min(K,10**5)):
    A,B,C = B+C,C+A,A+B
    if abs(A-B)>=10**18:
        print("Unfair")
else:
    print(A-B)
# Judge status: Accepted
N=int(input())
L=sorted(list(map(int,input().split())))
print(L[int(N/2)]-L[int(N/2)-1])
# Judge status: Wrong Answer
n,m=map(int,input().split())
cnt1=0
cnt2=0
flag=[-1]*(n+1)
for _ in range(m):
  p,s=map(str,input().split())
  p=int(p)
  if flag[p]==1:
    continue
  else:
    if s=='AC':
      cnt1+=1
      flag[p]=1
    else:
      cnt2+=1
print(cnt1,cnt2)
# Judge status: Accepted
abc=list(map(int,input().split()))
abc.sort()
if abc[0]+abc[1]==abc[2]:
    print("Yes")
    exit()
print("No")
# Judge status: Wrong Answer
n, k = map(int,input().split())
a = list(map(int,input().split()))

kaisuu = k % n

ans = a[kaisuu]
print(a[ans])
# Judge status: Accepted
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]

N = 26
L = [0] * N
for d in range(1, D + 1):
    mx = -10**18
    nx = -1

    for i, (c, l) in enumerate(zip(C, L)):
        r = c * (d - l)
        if mx < r:
            mx = r
            nx = i

    L[nx] = d
    print(nx + 1)
# Judge status: Wrong Answer
import numpy as np

d = int(input())

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

sd = np.zeros((d, 26), dtype=np.int)
for i in range(d):
  s = list(map(int, input().split()))
  s_array = np.array(s)
  sd[i, :] = s_array

pp = np.zeros(26, dtype=np.int)
  
for i in range(d):
  pp += c
  pp_max = np.argmax(pp)+1
  pp_max_val = np.max(pp)
  sd_max = np.argmax(sd[i,:])+1
  sd_max_val = np.max(sd[i,:])
  if pp_max_val >= sd_max_val:
    t = pp_max -1
    pp[pp_max-1] = 0
  else:
    t = sd_max
  print(t)
# Judge status: Wrong Answer
w,h,x,y=map(int,input().split())

if w/2==x and h/2==y:
    print(0.5,1)
else:
    print(0.5,0)
# Judge status: Wrong Answer
X,Y = map(int,input().split())
a = 1
x = X
mul = min(X,2)
cnt = 1
for i in range(10000):
  x *= mul
  if x>Y:
    cnt+=i
    break
print(cnt)
# Judge status: Accepted
def get_digit_sum(n):
    result = 0
    while n > 0:
        result += n % 10
        n //= 10
    return result


def main():
    ab_sum = int(input())
    answer = float("inf")
    for i in range(1, ab_sum // 2):
        answer = min(answer, get_digit_sum(i) + get_digit_sum(ab_sum - i))
    print(answer if ab_sum > 3 else 2)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
l = list(map(int, input().split()))

l.sort()
mid_id = int((N / 2) - 1)
ans = l[mid_id+1] - l[mid_id]

print(ans)
# Judge status: Wrong Answer
n = int(input())
p = input().split()

cnt = 0
for i in range(0, n-2):
    if (p[i] < p[i+1] < p[i+2]) or (p[i] > p[i+1] > p[i+2]):
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
a, b = map(float, input().split())
ans = int(a * (b * 100 + 0.5) / 100)
print(ans)
# Judge status: Accepted
n = int(input())

count = 0

for idx, a_i in enumerate(list(map(int, input().split()))):
    
    if (idx + 1) % 2 != 0 and a_i % 2 != 0:
        count += 1

print(count)
# Judge status: Wrong Answer
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if (dt < dist) | (dist % 2 != dt % 2):
    can = "NO"
print(can)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

ans = float('inf') 
sum_A = sum(A)
CumSum = 0


for i in range(N-1):
  CumSum = CumSum + A[i]
  ans = min(ans,(abs((sum_A - CumSum)-(CumSum))))

print(ans)
# Judge status: Wrong Answer
import math
 
R = int(input())
ans = R ** 2 * math.pi
print(ans)
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
total = []
num = 0
for i in reversed(range(N+1)):
    num += A[i]
    total.append(num)
total.reverse()
if A[0] == 1 and N == 0:
    print(1)
    exit()
if A[0] != 0:
    print(-1)
    exit()
ans = 1
num = 1
for i in range(1,N+1):
    num = min(2*num, total[i])
    ans += num
    num -= A[i]
    if num < 0:
        print(-1)
        exit()
print(ans)
# Judge status: Accepted
N = int(input())
s = input()
t = input()
ans = len(s) + len(t)
for i in range(N) :
    if s[N - 1 - i :] == t[:i + 1] :
        ans = len(s) + len(t) - (i + 1)
print(ans)
# Judge status: Accepted
s = input()

flag = True

while s != "":
    if s[-5:] == "dream":
        s = s[:-5]
    elif s[-7:] == "dreamer":
        s = s[:-7]
    elif s[-5:] == "erase":
        s = s[:-5]
    elif s[-6:] == "eraser":
        s = s[:-6]
    else:
        flag = False
        break

if flag:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
x,y=map(int,input().split())
lst=[]
lst.append(x)
for i in range(2,y):
    z=0
    z=lst[-1]*2
    if z>y:
        print(len(lst))
        break
    else:
        lst.append(z)
# print()
# Judge status: Accepted
n = int(input())
a = map(int, input().split())

num_count = {}
for num in a:
    if num in num_count:
        num_count[num] += 1
    else:
        num_count[num] = 1
ans = 0
for key in num_count:
    if key < num_count[key]:
        ans += num_count[key] - key
    elif key > num_count[key]:
        ans += num_count[key]
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
x = 1
y = n
for i in range(m):
    l, r = map(int, input().split())
    x = max(l, x)
    y = min(r, y)
print(max(0, y-x+1))
# Judge status: Accepted
n, d = map(int, input().split())

ans = 0

for _ in range(n):
    x, y = map(int, input().split())

    if (x**2+y**2)**(1/2) <= d:
        ans += 1

print(ans)
# Judge status: Wrong Answer
s=list(map(int,input().split()))
print(s.count(1))
# Judge status: Wrong Answer
n, k = map(int,input().split(" "))
trees = []
for i in range(n):
    trees.append(int(input()))

trees.sort()
min_val = trees[k-1] - trees[0]
for i in range(1, n - k + 1):
    min_val = min(abs(trees[n - k + 1] - trees[i]), min_val)
    
print(min_val)
# Judge status: Accepted
s=list(map(int,input().split()))
a=s[0]
b=s[1]
if s.count(a)==3:
    print(1)
elif s.count(a)==2:
    print(2)
elif s.count(b)==2:
    print(2)   
else:
  print(3)
# Judge status: Accepted
x, n = map(int, input().split())

if n != 0:
    ps = list(map(int, input().split()))

    ans = 0
    sa = x
    
    for i in range(0, 102):
        if i not in ps and abs(x-i) < sa:
            ans = i
            sa = x-i
    
    print(ans)
    
else:
    print(x)
# Judge status: Accepted
import math

n,d = map(int,input().split())
cnt = 0

for i in range(n):
    x,y = map(int,input().split())
    if math.sqrt(x**2 + y**2) <= d:
        cnt += 1

print(cnt)
# Judge status: Wrong Answer
N = int(input())

tannis = [1]

i = 1
while 6**i < N:
    tannis.append(6**i)
    i += 1

i = 1
while 9**i < N:
    tannis.append(9**i)
    i += 1

tannis.sort(reverse=True)
# print(tannis)

count = 0
i = 0
while N > 0:
    if N >= tannis[i]:
        count += N // tannis[i]
        N = N % tannis[i]
    else:
        i += 1

print(count)
# Judge status: Wrong Answer
line = input()
line2 = input()
line3 = input()
if line3[-1]=="a":
    print("A")
elif line3[-1]=="b":
    print("B")
elif line3[-1]=="c":
    print("C")
# Judge status: Wrong Answer
n = int(input())
l0 = 2
l1 = 1
L = 0
if n == 1:
    print(l0)
    exit()
elif n == 2:
    print(l1)
    exit()
else:
    for i in range(2, n+1):
        L = l0 + l1
        l0 = l1
        l1 = L
print(L)
# Judge status: Accepted
def resolve():
    S = int(input())
    DP = [0]*(S+1)
    DP[0] = 1
    for i in range(3, S+1):
        DP[i] = (DP[i-3] + DP[i-1]) % (10**9 + 7)
    print(DP[-1])
    
resolve()
# Judge status: Accepted
import numpy as np
H,N=map(int,list(input().split(" ")))
a=np.empty(N,dtype=int)
b=np.empty(N,dtype=int)
for i in range(N):
    a[i],b[i]=map(int,list(input().split(" ")))
dp=np.empty(H+1,dtype=int)
dp[0]=0
for h in range(1,H+1):
    t=h-a
    t[t<0]=0
    dp[h]=np.min(dp[t]+b)
print(dp[H])
# Judge status: Accepted
n = int(input())

zmax = -10**10
zmin = 10**10
wmax = -10**10
wmin = 10**10

for i in range(n):
    x, y = map(int, input().split())
    zref = x + y
    wref = x - y
    zmax = max(zmax, zref)
    zmin = min(zmin, zref)
    wmax = max(wmax, wref)
    wmin = min(wmin, wref)

ans = max(zmax - zmin, wmax - wmin)
print(ans)
# Judge status: Accepted
n = int(input())
if n < 105:
  print(0)
else:
  output = 0
  for i in range(105,n+1):
    if i % 2 == 0:
      continue
    yaku = 0
    for j in range(1,i+1):
      if i % j == 0:
        yaku += 1
      if yaku > 8:
        continue
    if yaku == 8:
      output += 1
  print(output)
# Judge status: Accepted
import numpy as np


def main(A, B, V, W, T):
    if abs(B-A) <= T*(V-W):
        return "YES"
    return "NO"


A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
print(main(A, B, V, W, T))
# Judge status: Accepted
n = int(input())
x=[0]*n
l=[0]*n
t=[0]*n
for i in range(n):
    x[i],l[i]=map(int,input().split())
    t[i]=[x[i],l[i]]
t=sorted(t,key=lambda x:x[0]+x[1])
right=t[0][0]+t[0][1]
count=1
for i in range(1,n):
    if t[i][0]-t[i][1]>=right:
        count+=1
        right=t[i][0]+t[i][1]
print(count)
# Judge status: Wrong Answer
a,b,m = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
xyc = [list(map(int,input().split())) for _ in range(m)]

price = 10**6
for x,y,c in xyc:
    k = A[x-1] + B[y-1] - c 
    if k < price:
        price = k
        
print(k)
# Judge status: Accepted
D=int(input())#365
c=list(map(int,input().split()))
s=[]
for i in range(D):
  s.append(list(map(int,input().split())))
  print((i+10)%26+1)
# Judge status: Wrong Answer
N, x = map(int,input().split())
a = list(map(int, input().split()))
b = a[::-1] 
ans1 = 0
ans2 = 0
for i in range(N-1):
    if a[i] + a[i+1] > x:
        ans1 += a[i] + a[i+1] - x
        a[i+1] -= a[i] + a[i+1] - x
for i in range(N-1):
    if b[i] + b[i+1] > x:
        ans2 += b[i] + b[i+1] - x
        b[i+1] -= b[i] + b[i+1] - x        
print(min(ans1,ans2))
# Judge status: Wrong Answer
n = int(input())
i = 0
ans = []
while n:
    i += 1
    if n%(2**i):
        n -= (-2)**(i-1)
        ans.append("1")
    else:
        ans.append("0")
print("".join(ans[::-1]))
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
if a > b:
	print(0)
else:
	print((n - 2) * (b - a) + 1)
# Judge status: Accepted
h1,m1,h2,m2,k=map(int,input().split())

ans=(h2-h1)*60+(m2-m1)
ans-=k

print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
a,b=min(a,b),max(a,b)
if a<=c<=b:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
s=input()
if n%2==0:
    if s[0:n//2]==s[n//2:-1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))

tt = [0] * n
tt[0] = 1
ans_l = [1]
i = 1

for j in range(k):
    i = a[i-1]
    if tt[i-1] == False:
        tt[i-1] = 1
        ans_l.append(i)
    else:
        break

d = ans_l.index(i)
k -= d
ans = k % (len(ans_l)-d)
print(ans_l[ans+d])
# Judge status: Accepted
N = int(input())
s = input()
t = input()

ti = 1
ma = 0
for i in range(N - 1, -1, -1):
    if s[i:] == t[:ti]:
        ma = ti    
    ti += 1
print(2 * N - ma)
# Judge status: Accepted
a, b, c, d = list(map(int, input().split()))
while(True):
    c -= b
    if c <= 0:
        print('Yes')
        exit()
    a -= d
    if a <= 0:
        print('No')
        exit()
# Judge status: Accepted
n=int(input())
arr=list(map(int,input().split()))
for i in range(n-2,-1,-1):
  if arr[i]>arr[i+1]:
    arr[i]-=1
    if arr[i]>arr[i+1]:
      print('No')
      break
else:
  print('Yes')
# Judge status: Accepted
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = min(a)+min(b)
for i in range(M):
    x,y,c = map(int,input().split())
    ans = min(ans,a[x-1]+b[y-1]-c)
print(ans)
# 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
n=int(input())

for i in range(1,10):
    syou=n/i
    if syou.is_integer():
        if 1<=syou and syou<=9:
            print("Yes")
            exit()

print("No")
# Judge status: Accepted
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [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 b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
# Judge status: Accepted
s= list(input())
s=set(s)
if len(s)%2==1:
    print('No')
else:
    if len(s) == 2:
        if "W" in s and "E" in s or "S" in s and "N" in s:
            print("Yes")
        else:
            print('No')
    else:
        print('Yes')
# Judge status: Accepted
def main():
    N = int(input())
    AB = [tuple(map(int, input().split())) for _ in range(N)]
    AB.sort(key=lambda x:x[1])
    t = 0
    for a, b in AB:
        t += a
        if t > b:
            return False
    return True

print('Yes' if main() else 'No')
# Judge status: Wrong Answer
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]

count=0
for i in range(a, b+1):
    if str(i)[:2] == str(i)[3:]:
        count+=1
print(count)
# Judge status: Accepted
a,b=list(map(int,input().split()))

if a%b==0:
  print(0)
else: 
  print(1)
# Judge status: Accepted
from itertools import combinations_with_replacement
N, M, Q = map(int,input().split())
ls = []
for _ in range(Q):
    a,b,c,d = map(int,input().split())
    ls.append((a-1,b-1,c,d))
ans = -1
for A in combinations_with_replacement(range(1,M+1),r=N):
    sm = 0
    for a,b,c,d in ls:
        if A[b]-A[a] == c:
            sm += d
    ans = max(ans, sm)
print(ans)
# Judge status: Accepted
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = read().decode().rstrip()

print("ABC") if S == 'ARC' else print("ARC")
# Judge status: Accepted
N, WM = map(int, input().split())
W = []
V = []
dp = [[0] * (WM + 1) for _ in range(N + 1)]

for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

for i in range(N):
    for w in range(WM + 1):
        if w - W[i] >= 0:
            dp[i + 1][w] = max(dp[i + 1][w], dp[i][w - W[i]] + V[i])
        dp[i + 1][w] = max(dp[i + 1][w], dp[i][w])

print(dp[N][WM])
# Judge status: Accepted
n=int(input())
ans=0
m=1
while n>1:
  n=n//2
  ans+=m
  m*=2
print(ans+m)
# Judge status: Wrong Answer
# coding: utf-8
import math

def main():
    a, b = map(int, input().split())
    tmp_a_min = math.floor(a / 0.08)
    tmp_a_max = math.floor((a+1) / 0.08)
    # print(tmp_a_min, tmp_a_max)
    for i in range(tmp_a_min, tmp_a_max):
        if math.floor(i * 0.1) == b:
            print(i)
            break
    else:
        print(-1)
main()
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
H = iil()

cnt = 0
ans = 0

for i in range(1,len(H)):
#    print(i)
    if H[i-1] >= H[i]:
#        print('hoge')
        cnt += 1
    else:
        ans = max(cnt,ans)
        cnt = 0
print(max(cnt,ans))
# Judge status: Accepted
A,B=map(int,input().split())
if A<10 and B<10:
  print(A*B)
else:
  print(-1)
# Judge status: Wrong Answer
from fractions import gcd
n,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x.sort()
ans=x[1]-x[0]
if n>1:
    for i in range(2,n):
        ans=gcd(ans,x[i]-x[i-1])
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
isAC = [False] * (N+1)
penalties = [0] * (N+1)
ac, penalty = (0, 0)
for _ in range(M):
  p, s = input().split()
  p = int(p)
  if s == "AC":
    if not isAC[p]:
      isAC[p] = True
      ac += 1
      penalty += penalties[p]
  else:
    penalties[p] += 1
print(ac, penalty)
# Judge status: Accepted
n=int(input())

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

for i in range(3):
  dp[0][i]=0
  
a=[]


  
for _ in range(n):
  d=list(map(int,input().split()))
  a.append(d)
  
for x in range(n):
  for y in range(3):
    for z in range(3):
      if y!=z:
        dp[x+1][z]=max(dp[x+1][z],dp[x][y]+a[x][z])
        
print(max(dp[n][0],dp[n][1],dp[n][2]))
# Judge status: Accepted
n,x,t = map(int, input().split())
if n % x ==0:
    print((n // x) * t)
else:
    print((n // x + 1) * t)
# Judge status: Accepted
X = int(input())
a = [100, 101, 102, 103, 104, 105]
dp = [[False]*100010 for _ in range(10)]
dp[0][0] = True

for i in range(6):
    for j in range(X+1):
        dp[i+1][j] |= dp[i][j]
        if j >= a[i]:
            dp[i+1][j] |= dp[i][j-a[i]]
            dp[i+1][j] |= dp[i+1][j-a[i]]
if dp[6][X]:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A>=13:
  fare=B
elif A>=6 and A<=12:
  fare=B/2
else:
  fare=0
print(fare)
# Judge status: Accepted
inputf = input

a,b = inputf().split(' ')
a_, b_ = inputf().split(' ')
a_ = int(a_)
b_ = int(b_)
c = inputf()

if c==a:
    a_ -= 1
else:
    b_ -= 1
    
print(a_, b_)
# Judge status: Accepted
n = int(input())
dp = [0 for i in range(n+1)]

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            res = x**2+y**2+z**2+x*y+y*z+z*x
            if res<=n:
                dp[res]+=1

for i in range(1,n+1):
    print(dp[i])
# Judge status: Wrong Answer
n=int(input())
s=input()
w_cnt=s.count(".")

ans=[]
b=0
w=w_cnt

for i in range(n):
    if s[i]=="#":
        b+=1
    else:
        w-=1
    ans.append(b+w)

print(min(ans))
# Judge status: Accepted
from math import ceil
H = int(input())
W = int(input())
N = int(input())
print(ceil(N/max(H,W)))