peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())

len_x = tx - sx
len_y = ty - sy

ans = []
for _ in range(len_x):
    ans.append("R")
for _ in range(len_y):
    ans.append("U")
for _ in range(len_x):
    ans.append("L")
for _ in range(len_y):
    ans.append("D")
    
ans.append("D")
for _ in range(len_x + 1):
    ans.append("R")
for _ in range(len_y + 1):
    ans.append("U")
ans.append("L")
ans.append("U")
for _ in range(len_x + 1):
    ans.append("L")
for _ in range(len_y + 1):
    ans.append("D")
ans.append("R")

print("".join(ans))
# Judge status: Accepted
s = list(input())
ans = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        # print(s[i:j+1])
        if all(x == 'A' or x == 'C' or x == 'G' or x == 'T' for x in s[i:j+1]):
            # print('Yes')
            if ans < len(s[i:j+1]):
                ans = len(s[i:j+1])
        # if expression:
        #     pass
    # print(s[:i], len(s[:i]))

print(ans)
# Judge status: Accepted
n=int(input())
L=set()
for i in range(n):
	s=input()
	L.add(s)
print(len(L))
# Judge status: Accepted
n, m = [int(i) for i in input().split()]
ans = 0
diff = m - n
if diff >= 2:
    x = n * 2
    y = m - x
    ans += n
    ans += y // 4
else:
    ans = m // 2
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
c4 = 0
c2 = 0
for i in a:
    if i%4 == 0:
        c4 += 1
    elif i%2 == 0:
        c2 += 1
c0 = n - c4 - c2

ans = False
if c2 < 2:
    if c0 + c2 <= 2*c4:
        ans = True
else:
    if c0 <= c4*2 + (c2//2) - 1:
        ans = True
if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import fractions
x, y = map(int, input().split())

ans = -1
for i in range((x*y)//fractions.gcd(x, y), 0, -x):
    if i%y != 0:
        ans = i
        break
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
ab = [tuple(map(int, input().split())) for i in range(M)]
ab = [i for inner in ab for i in inner]

for i in range(1, N + 1):
    print(ab.count(i))
# Judge status: Accepted
n=int(input())

su = 0
for i in range(1,n+1):
    m = int(n/i)
    su += int(m*(2*i + (m-1)*i)/2)
    

print(su)
# Judge status: Accepted
def main():
  import sys
  input = sys.stdin.readline
  from fractions import gcd
  def lcm(a, b):
      return a * b // gcd(a, b)
  
  N = int(input())
  A = tuple(sorted(list(map(int,input().split()))))
  MOD = 10**9+7
  
  L = 1
  for a in A:
    L = lcm(a,L)
  ans = 0
  for a in A:
    #ans += L//a
    ans += L*pow(a,MOD-2,MOD)
  print(ans%MOD)

if __name__ == '__main__':
  main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
x = int(input())

ans = x
while True:
    flag = True
    for i in range(2, x):
        if ans % i == 0:
            ans += 1
            flag = False
    if flag:
        print(ans)
        break
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

Ans = [0 for i in range(N)]

X = 0

for i in A:
  X ^= i

for i in range(N):
  Ans[i] = X ^ A[i]
print(*Ans)
# Judge status: Accepted
import sys

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


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

    x = A - B

    print(max(0, C - x))


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

delta = abs(ABC[2]-ABC[0])+abs(ABC[2]-ABC[1])

if delta % 2:
    print((delta+1)//2+1)
else:
    print(delta//2)
# Judge status: Accepted
s1s2s3 = str(input())
print (s1s2s3.count('1'))
# Judge status: Accepted
n = input()
*a, = map(int, input().split())
d = {}
for i in a:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
b = [i for i in d.keys() if d[i] >= 2]
if len(b) == 0:
    print(0)
elif len(b) == 1:
    if d[b[0]] >= 4:
        print(b[0]**2)
    else:
        print(0)
else:
    b.sort()
    if d[b[-1]] >= 4:
        print(b[-1]**2)
    else:
        print(b[-1]*b[-2])
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
l.sort()
num=[0]*(max(l)+2)
for i in range(n):
    num[l[i]]=i
for i in range(1,len(num)):
    if num[i]==0:
        num[i]=num[i-1]
ans=0
num3=l[n-1]
for i in range(n-2):
    for j in range(i+1,n-1):
        ans+=max(0,num[min(num3,l[i]+l[j]-1)]-j)
print(ans)
# Judge status: Wrong Answer
N,L = map(int,input().split())

s = 0
for i in range(1,N+1):
    s += L+i-1

if L >= 0:
    eat = L
elif L+N < 0:
    eat =  L+N-1
else:
    eat = 0

print(s-eat)
# Judge status: Wrong Answer
l = int(input())*10
Ma = 0

for i in range(0, l+1, 1):
    for j in range(0, l-i, 1):
        z = l - (i+j)
        result = z*i*j
        if(result>Ma):
            Ma = result
print(Ma/1000)
# Judge status: Accepted
from math import ceil

n = int(input())
if n%111 == 0:
    print(n)
else:
    print(111*ceil(n/111))
# Judge status: Accepted
LI = lambda: list(map(int, input().split()))

S = input()


def main():
    n = len(S)
    sn = len(set(S))
    ans = "yes" if sn == n else "no"
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n=int(input())
l=list()
if n==1:
  print(0)
else:
  if n%2==0:
    l.append(2)
  if n%3==0:
    l.append(3)
  i=5
  while(i*i<=n):
    if n%i==0:
      l.append(i)
    elif n%(i+2)==0:
      l.append(i+2)
    i+=6
  l.append(n)
  k=0
  for i in l:
    z=i
    while(n%z==0 and n>0):
      n=n//z
      z=i*z
      k+=1
  print(k)
# Judge status: Accepted
# 初期入力
N =int(input())
S =input()

#
harf =len(S)//2
T1 =S[:harf]
T2 =S[harf:]
if T1 ==T2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())

print( 800 * N - 200 * (N//15) )
# Judge status: Wrong Answer
N , M =map(int,input().split())


if 1<=N<=100 and 0 <= M <= N:
    if N==M:
        print("Yes")
        
    else:
        print("no")
        
else:
    print("No")
# Judge status: Accepted
N = int(input())
S = input()

def foo(alphabet, n):
    NUM_OF_ALPHABETS = 26
    diff = ord(alphabet) - ord('A')
    index = (diff + n) % NUM_OF_ALPHABETS
    result = chr(ord('A') + index)

    return result


def calculate(str, n):
    calculated = ''.join([foo(alphabet, n) for alphabet in str])

    return calculated

answer = calculate(S, N)

print(answer)
# Judge status: Wrong Answer
a,b = map(int,input().split())

if a > b:
  print("Alice")
elif b< a:
  print("Bob")
else:
  print("Draw")
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    N = int(input())
    flag = False
    for i in range(1,10):
        if N % i == 0 and N // i < 10:
            flag = True
            break
    if flag:
        print('Yes')
    else:
        print('No')



main()
# Judge status: Accepted
n = int(input())

res = 0
for i in range(1,n+1):
    if i%3==0 or i%5==0:
        pass
    else:
        res += i
print(res)
# Judge status: Accepted
import sys
n = int(input())
li = []
for _ in range(n):
    i = int(input())
    li.append(i)
li.sort()
s = sum(li)
if s % 10 != 0:
    print(s)
    sys.exit()

for l in li:
    if l%10 != 0:
        s -= l
        break
if s%10 == 0:
    print(0)
else:
    print(s)
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))
B=list(map(int, input().split()))

before=sum(A)
for n in range(N):
    temp = A[n]
    A[n] = max(0, A[n]-B[n])
    B[n] = max(0, B[n]-temp)
    A[n+1] = max(0, A[n+1]-B[n])
after=sum(A)
print(before-after)
# Judge status: Accepted
A,B,K = map(int, input().split())
if A+B < K:
    print(0,0)
elif A >= K:
    print(A-K,B)
else:
    print(0,A+B-K)
# Judge status: Wrong Answer
X,Y,N=map(int,input().split())
max_X=X
max_Y=Y
current_min_x=0
current_min_y=0
current_max_x=X
current_max_y=Y
xy=[list(map(int,input().split())) for _ in range(N)]
for x,y,a in xy:
  n=0
  if a==1:
    current_min_x=max(0, x)
  elif a==2:
    current_max_x=min(x, max_X)
  elif a==3:
    current_min_y=max(0, y)
  elif a==4:
    current_max_y=min(y, max_Y)
result=(current_max_x-current_min_x)*(current_max_y-current_min_y)
print(result if result > 0 else 0)
# Judge status: Accepted
a,b,c,d = map(int, input().split())
ans='Yes'
while a>0 and c>0:
    c-=b
    if c<=0:
        break
    a-=d
    if a<=0:
        ans='No'
        break
print(ans)
# Judge status: Wrong Answer
a=list(map(int,input().split()))

b=a[0]+a[1]
while b>24:
  if b>24:
    b-=24

print(b)
# Judge status: Accepted
def main():
    s = input()
    if s[-1] == "3":
        print("bon")
    elif int(s[-1]) in [0, 1, 6, 8]:
        print("pon")
    else:
        print("hon")


if __name__=="__main__":
    main()
# Judge status: Wrong Answer
n=int(input())
count=0
keep=10*100
tempkeep=0
import math
for i in range(0,5):
  a=int(input())
  if i==0:
    drop=0
  else:
    drop=1
  if n%a==0:
    temp=n//a
  else:
    temp=n//a+1
  if a<keep:
    count+=temp-tempkeep+drop
    tempkeep=temp
    keep=a
  else:
    count+=1
print(count)
# Judge status: Wrong Answer
s = input().split()

N = int(s[0])
R = int(s[1])

if N < 9:
  ans = R + 100 *(10 - N)
else:
  ans = R

print(ans)
# Judge status: Accepted
n, m, K = map(int, input().split())
print("YNeos"[all(k*(m-l)+(n-k)*l-K for k in range(n+1) for l in range(m+1))::2])
# Judge status: Accepted
n = int(input())

grid = [[0 for _ in range(9)] for _ in range(9)]
ans = 0
for i in range(1, n + 1):
    if i % 10 == 0:
        continue
    else:
        s = str(i)
        grid[int(s[0]) - 1][int(s[-1]) - 1] += 1

for i in range(9):
    for j in range(9):
        ans += grid[i][j] * grid[j][i]
print(ans)
# Judge status: Accepted
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n,a,b,c,d = readInts()
a-=1
b-=1
c-=1
d-=1
s = readChar()
if (a-b)*(c-d)<0:
  if "..." in s[b-1:d+2] and "##" not in s[a:c]:
    print("Yes")
  else:
    print("No")
else:
  if "##" not in s[a:d+1]:
    print("Yes")
  else:
    print("No")
# Judge status: Wrong Answer
input()
print(sum(sorted(list(map(int, input().split())))[1:]))
# Judge status: Wrong Answer
x, y = map(int,input().split())

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

if x in a and y in a:
  print("YES")
elif x in b and y in b:
  print("YES")
elif x in c and y in c:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
num_in = [int(i) for i in input().split()]

def calc_dig_sum(num):
    num_str = str(num)
    ret = 0
    for c in num_str:
        ret += int(c)
    return ret

sum = 0
for i in range(1, num_in[0]+1):
    if num_in[1] <= calc_dig_sum(i) <= num_in[2]:
        sum += i

print(sum)
# Judge status: Wrong Answer

def resolve():
	n, m = map(int, input().split())
	mod = 10**9+7
	if abs(n - m) > 1:
		print(0)
		return
	print((n % mod) * (m % mod) * 2 % mod)
resolve()
# Judge status: Wrong Answer
def divisible(n):
 ans = 0
 while n%2 == 0:
  n /= 2
  ans += 1
 return ans
 
N = int(input())
 
b = 0

c = 0
 
for i in range(1,N+1):
    if(divisible(i) > b):
      b = divisible(i)
      c = i
    
print(c)
# Judge status: Accepted
a,b=input().split()
x=int(a+b)
for i in range(int(x**0.5)+1):
    if i**2 ==x:
        print('Yes')
        exit()
print('No')
# Judge status: Accepted
import math

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

if abs(n-m) >= 2:
  print(0)
  exit()
  
if n == m:
  print((math.factorial(n) * math.factorial(m) * 2)%(10**9 + 7))
  
elif n+1 == m:
  print((math.factorial(m) * math.factorial(n))%(10**9 + 7))
elif m+1 == n:
  print((math.factorial(n) * math.factorial(m))%(10**9 + 7))
# Judge status: Accepted
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

S = list(readline().rstrip())
K = int(readline())
N = len(S)
for i in range(N):
    t = ord(S[i])-97
    if t == 0:
        continue
    if 26 - t <= K:
        S[i] = 'a'
        K -= 26-t
S[-1] = chr((ord(S[-1])-97 + K%26)%26 + 97)
print(''.join(S))
# Judge status: Accepted
s = input()

#s = '31415926535897932384626433832795028841971693993751058209749445923078164062862089986280'

print('Yes' if sum(int(t) for t in s) % 9 == 0 else 'No')
# Judge status: Accepted
x, y = map(int, input().split())

if x <= y:
    if 0 <= x or y <= 0:
        print(y-x)
    elif abs(x) >= abs(y):
        print(abs(x) - abs(y) + 1)
    else:
        print(1+abs(y)-abs(x))
else:
    if 0 < y or x < 0:
        print(1+abs(x-y)+1)
    elif x == 0 or y == 0:
        print(abs(x-y)+1)
    elif abs(x) >= abs(y):
        print(1+abs(x)-abs(y))
    else:
        print(abs(y)-abs(x)+1)
# Judge status: Accepted
#!/usr/bin/env python3

INF = 10**9 + 1

def solve(n,a):
    ans = 0
    minusCount = 0
    minimumNum = INF
    lst = []
    for i in range(n):
        if a[i] < 0:
            minusCount += 1
        ans += abs(a[i])
        minimumNum = min(minimumNum,abs(a[i]))
    if minusCount % 2 == 0:
        pass
    else:
        ans -= minimumNum*2
    return ans


def main():
    N = int(input())
    a = list(map(int,input().split()))
    print(solve(N,a))

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()
if S[0] == 'A' and 'C' in S[2:-1]:
    idx = S.index('C')
    if all(c.islower() or i in (0, idx) for i, c in enumerate(S)):
        print('AC')
    else:
        print('WA')
else:
    print('WA')
# Judge status: Accepted
X = int(input())

for i in range(1,361):
    if (360*i)%X==0:
        ans=(360*i)//X
        break
print(ans)
# Judge status: Accepted
from collections import defaultdict
d = defaultdict(int)
N = int(input())
A = list(map(int, input().split()))

for i in A:
    d[i] += 1

for i in range(1,N+1):
    print(d[i])
# Judge status: Accepted
# A - Sorted Arrays
import numpy as np

N = int(input())
A = list(map(int, input().split()))
sgn = 0
ans = 1

for i in range(N-1):
    tmp = np.sign(A[i+1]-A[i])
    if tmp*sgn<0:
        ans += 1
        sgn = 0
    else:
        sgn = np.sign(2*sgn+tmp)

print(ans)
# Judge status: Accepted
x, y = map(int, input().split())

if x <= y:
  print(min(y - x, 1 + abs(abs(y) - abs(x))))
elif x * y <= 0:
  print(1 + abs(abs(y) - abs(x)))
else:
  print(2 + abs(y - x))
# Judge status: Accepted
N, A, B = map(int, input().split())
ans = N//(A+B)*A
if A > N % (A+B):
  ans +=  N % (A+B)
else:
  ans += A
print(ans)
# Judge status: Accepted
N=int(input())
c=1
for i in range(N):
  c *= i+1
  c = c % (10**9+7) # ここで、掛け算のスケールを減らすのか！

print(c)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
if a<c<b:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
(n,m)=map(int,input().split())
x = [int(i) for i in input().split()]
sum=sum(x)
print(n-sum)if n>m else print("-1")
# Judge status: Accepted
n = int(input())
numbers = [int(i) for i in input().split(" ")]

now = 1

for i in range(n):
    
    if numbers[i]==now:
        now += 1

if now==1 and n>1:
    print(-1)
else:
    print(n-(now-1))
# Judge status: Accepted
from collections import deque

n, m = map(int, input().split())
links = [[] for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    links[a].append(b)
    links[b].append(a)

ans = [-1] * n
ans[0] = 0
q = deque([(0, 0)])
while q:
    room, prev = q.popleft()
    for next_ in links[room]:
        if ans[next_] < 0:
            ans[next_] = room
            q.append((next_, room))

print('Yes')
for i in range(1, n):
    print(ans[i] + 1)
# Judge status: Wrong Answer
N,Q=map(int,input().split())
S=input()
lr = [list(map(int,input().split())) for _ in range(Q)]

indices=[0]*(N+1)
for i in range(1,N+1):
  if S[i-1:i+1]=='AC':
    indices[i] += indices[i-1] + 1
  else:
    indices[i] += indices[i-1]

print(indices)
for i in range(Q):
  l,r=lr[i]
  print(indices[r-1]-indices[l-1])
# Judge status: Accepted
s=input()
print("no" if len(s)-len(set(s))!=0 else "yes" )
# Judge status: Accepted
N, K = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
A.sort()
for i in range(N):
    if K>A[i][1]:
      K -= A[i][1]
    else:
      ans = A[i][0]
      break
print(ans)
# Judge status: Accepted
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())
    s = input()[:-1].decode()
    c1 = 0
    c2 = 0
    for i in range(n):
        if s[i] == '(':
            c1 += 1
        elif s[i] == ')':
            c1 -= 1
        if c1 < 0:
            c1 = 0
            c2 += 1
    print('(' * c2, s, ')' * c1, sep='')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
# Judge status: Wrong Answer
N = int(input())
a_list = list(map(str, input().split()))
ans_index = []
before_index = -1
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
for i in range(len(a_list)):
    if (a_list.count(i+1) >= 1) and (a_list.index(i+1) > before_index):
        val = a_list.index(i+1)
        before_index = val
        ans_index.append(val)

result = N - len(ans_index)
print(result)
# Judge status: Wrong Answer
a=input()
print=(chr(ord(a)+1))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
num = 0
for a in A:
  num ^= a

l = []

for a in A:
  ans = a^num
  l.append(ans)
print(*l)
# Judge status: Wrong Answer
h = int(input())
counter = 0
while h > 1:
  counter += 1
  h = h // 2
  
print(counter)
# Judge status: Accepted
num_val = input()
num_list = list(map(int, list(input().split())))

even_list = [i for i in num_list if (i%2==0) & (i%3!=0 and i%5!=0)]
if len(even_list) == 0:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Accepted
n=int(input())
happy=[list(map(int,input().split())) for _ in range(n)]
DP=[[0,0,0] for _ in range(n+1)]
for i in range(n):
    a,b,c=happy[i]
    DP[i+1][0]=max(DP[i][1],DP[i][2])+a
    DP[i+1][1]=max(DP[i][2],DP[i][0])+b
    DP[i+1][2]=max(DP[i][0],DP[i][1])+c
print(max(DP[-1]))
# Judge status: Accepted
n, a, b = map(int, input().split())
unit = n // (a + b)
rest = n % (a + b)
result = unit * a
if rest <= a:
    result += rest
else:
    result += a
print(result)
# Judge status: Wrong Answer
import math
from itertools import  accumulate
n = int(input())
tmp = n

if n == 1:
    print(1)
    exit()
lis = [0]*n
lis[0] = 1
lis[1] = 3

a = 0
for i in range(2,n-1):
    lis[i] = lis[i-1] + (i+1)
    if lis[i] >= n:
        a = i+1
        break

ans = []
while n>1:
    ans.append(a)
    n -= a
    a -= 1

if sum(ans) != tmp:
    ans.append(1)

for i in sorted(ans):
    print(i)
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())

if H >= W:
  if N//H != 0:print(N//H + 1)
  else: print(N//H)
else:
  if N//H != 0:print(N//W + 1)
  else: print(N//W)
# Judge status: Accepted
from collections import Counter

n = int(input())
al = list(int(input()) for _ in range(n))
c = Counter(al)
ans = 0
for k, v in c.items():
    if v%2 != 0:
        ans += 1

print(ans)
# Judge status: Accepted
import math
A, B = map(int, input().split())
C = A * B // math.gcd(A, B)
print(C)
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]

for i in range(n-m):
    for j in range(n-m):
        ans = 0
        for ii in range(m):
            for jj in range(m):
                if b[ii][jj] == a[i+ii][j+jj]:
                    ans += 1
        if ans == m*m:
            print("Yes")
            exit()

print("No")
# Judge status: Accepted
N,M=list(map(int, input().split()))
S=set()
D=[]
for i in range(M):
    l=list(map(int, input().split()))
    if l[0]==1:
        S.add(l[1])
    else:
        D.append(l)
# print(S)
# print(D)
D.sort()
L=len(D)
for i in range(L):
    if D[i][1]==N and D[i][0] in S:
        print('POSSIBLE')
        exit()
else:
    print('IMPOSSIBLE')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
arr = [False] * n

for i in range(n, 0, -1):
    if a[i - 1] == 1:
        if sum(arr[0::i]) % 2 == 0:
            arr[i - 1] = True
    else:
        if sum(arr[0::i]) % 2 == 1:
            arr[i - 1] = False

if not any(arr):
    print(0)
else:
    print(sum(arr))
    ans = []
    for i, x in enumerate(arr):
        if x:
            ans.append(i + 1)
    print(*ans)
# Judge status: Accepted
x = int(input())
print(int(not(x)))
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = []
for _ in range(M):
  BC.append(list(map(int, input().split())))
BC = sorted(BC, key=lambda x:x[1],reverse=True)  
for b, c in BC:
  A.extend([c] * b)
  if len(A)>=2*N:
    break
A = sorted(A, reverse=True)
print(sum(A[:N]))
# Judge status: Accepted
A,B=map(int,input().split())
res=0
for i in range(A,B+1):
    cnt=0
    s=str(i)
    for j in range(len(s)//2):
        if(s[j]==s[len(s)-1-j]):
            cnt+=1
    if(len(s)//2==cnt):
        res+=1
print(res)
# Judge status: Accepted
sl = ["Sunny","Cloudy","Rainy"]
S = input()
ans = 0
for i in range(len(sl)):
    if (S == sl[i]):
        ans = (i+1) % 3

print(sl[ans])
# Judge status: Accepted
h,n = map(int, input().split())
magics = [tuple(map(int, input().split())) for _ in range(n)]
max_a = sorted(magics, key=lambda x: x[0], reverse=True)[0][0]
dp = [0]*(h+max_a)
for i in range(1, h+max_a):
  dp[i] = min(dp[i-a]+b for a,b in magics)
print(min(dp[h:]))
# Judge status: Accepted
n  = int(input())

sList = []
for i in range(n-1):
  sList.append(tuple(map(int,input().split())))

#print("sLIst",sList)

for i in range(len(sList)):
  timeCount = sList[i][1]+sList[i][0] 
  for j in range(i+1,len(sList)):
    if timeCount < sList[j][1]:
      timeCount = sList[j][1]
      
    timeTmp = timeCount % sList[j][2]
    if timeTmp == 0:
      timeCount += sList[j][0]
    else:
      timeCount += sList[j][2] - timeTmp + sList[j][0]
  print(timeCount)

print(0)
# Judge status: Accepted
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 10**9
for i in range(M):
    x, y, c = map(int, input().split())
    ans = min(ans, a[x-1]+b[y-1]-c)
ans = min(ans, min(a)+min(b))
print(ans)
# Judge status: Accepted
q, h, s, d = map(int, input().split())
n = int(input())

# 2L min cost
cost2 = min(q*8, h*4, s*2, d)
# 1L min cost
cost1 = min(q*4, h*2, s)

ans = (n // 2) * cost2
if n % 2 == 1:
  ans += cost1
print(ans)
# Judge status: Accepted
n=int(input())
s=input()
alpha=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

out=[]
for i in range(len(s)):
    out.append(alpha[(alpha.index(s[i])+n)%26])

print("".join(out))
# Judge status: Accepted
#階乗
F = 10**6+5
mod = 10**9+7
fact = [1]*F
inv = [1]*F
for i in range(2,F):
    fact[i]=(fact[i-1]*i)%mod
inv[F-1]=pow(fact[F-1],mod-2,mod)
for i in range(F-2,1,-1):
    inv[i] = (inv[i+1]*(i+1))%mod

x,y=map(int,input().split())
t=(x+y)//3
if (x+y)%3!=0 or x<t or y<t:
    print(0)
else:
    print(fact[t]*inv[x-t]*inv[2*t-x]%mod)
# Judge status: Accepted
N = int(input())
S = input()
ans = 0
x = 0
for s in S:
  if s == 'I':
    x += 1
  else:
    x -= 1
  
  ans = max(ans, x)

print(ans)
# Judge status: Wrong Answer
x = int(input())
year = 0
deposit = 100

while(deposit < x):
	year += 1
	deposit = int(deposit * 1.01)

print(year)
# Judge status: Accepted
A,B = map(int,input().split())
if A >= 13:print(B)
elif 6 <= A:print(B//2)
else:print(0)
# Judge status: Accepted
s, w = [int(i) for i in input().split()]
if s <= w:
  print("unsafe")
else:
  print("safe")
# Judge status: Accepted
from functools import reduce
from fractions import gcd

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)
# Judge status: Accepted
N=int(input())

answer=0

for i in range(int(pow(N,1/2)),0,-1):
    if N%i==0:
        answer=(i-1)+(N//i-1)
        break
print(answer)
# Judge status: Accepted
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
ans ={i:0 for i in range(1,N +1)}
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            a =x*x +y*y +z*z +x*y +y*z +z*x
            if a<= N:
                ans[a] +=1
for i in range(1,N+1):
    print(ans[i])
# Judge status: Wrong Answer
a=int(input())
b=int(input())
for i in range(1,3):
    if i!=a and i!=b:
        print(i)