peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from bisect import bisect, bisect_left

N = int(input())
dp = [1]*N

for _ in range(N):
  a = -int(input())
  n = bisect(dp, a)
  dp[n] = a

print(sum( 1 for i in dp if i <= 0 ))
# Judge status: Accepted
num = int(input())
count = 0
for i in range(num):
  ab = input().split(" ")
  a = int(ab[0])
  b = int(ab[1])
  if a == b:
    count += 1
    if count >= 3:
      break
  else:
    count = 0
if count >= 3:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
X , Y = map(int, input().split())

if X%Y == 0:
  print(-1)
else:
  i = 2
  while True:
    if X*i > 10**18:
      print(-1)
      break
    if X*i%Y != 0:
      print(X*i)
      break
    i += 1
# Judge status: Accepted
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353
import numpy

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

a = numpy.argsort(A)
b = []
for i in range(N):
    b.append(str(a[i]+1))

print(" ".join(b))
# Judge status: Accepted
n = int(input())

total = 0

for i in range(1, n+1):
  if i % 15 == 0:
      continue
  elif i % 3 == 0:
      continue
  elif i % 5 == 0:
      continue
  else:
      total += i
    
print(total)
# Judge status: Accepted
n, k = map(int,input().split())

n = n % k
if abs(n - k) < n:
    print(abs(n - k))
else:
    print(n)
# Judge status: Accepted
s,w=map(int,input().split())
if s>w:
  print('safe')
else:
  print('unsafe')
# Judge status: Wrong Answer
from itertools import combinations
S = int(input())
n = S // 3
ans = -1
for k in range(n + 1):
  ans = ans + 1
print(ans)
# Judge status: Accepted
s = list(input())
c0 = s.count("0")
c1 = s.count("1")
if c0 >= c1:
    print(2*c1)
else:
    print(2*c0)
# Judge status: Accepted
N,K,X,Y=[int(input()) for i in range(4)]

print(X*K+Y*(N-K) if N-K > 0 else X*N)
# Judge status: Accepted
N, W = map(int, input().split())
items = [[0, 0]]
for _ in range(N):
    items.append(list(map(int, input().split())))

dp = [[0 for _ in range(W + 1)] for _ in range(N + 1)]

for i in range(1, N + 1):
    for j in range(W + 1):
        if j - items[i][0] >= 0:
            dp[i][j] = max(dp[i - 1][j - items[i][0]] + items[i][1], dp[i - 1][j])
        else:
            dp[i][j] = dp[i - 1][j]

print(max(dp[N]))
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

A.sort()

m = A[-1] / 2
diff = abs(A[0] - m)
r = A[0]
for a in A:
    tmp = abs(a - m)
    if tmp < diff:
        diff = tmp
        r = a

print(int(2 * m), r)
# Judge status: Accepted
h,n=map(int,input().split())
c=[list(map(int,input().split()))for _ in range(n)]
d=[0]*20002
for i in range(h):d[i]=min(d[i-a]+b for a,b in c)
print(d[h-1])
# Judge status: Wrong Answer
n,c,k = map(int,input().split())
t = []
for i in range(n):
    t.append(int(input()))
    
t = sorted(t)
ans = 1
passenger = 0
#first = 0
for i in range(n):
#    if first == 0:
#        first = t[i]
    if passenger < c and t[i] + k > t[i]:
        passenger +=1
        if i == n-1:
            ans +=1
    else:
        passenger = 0
#        first = 0
        ans +=1
print(ans)
# Judge status: Wrong Answer
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

k = int(input())

count = 0
from itertools import product
for a in range(1, k+1):
    for b in range(a, k+1):
        for c in range(b, k+1):
            count += gcd(a, b, c)

print(count)
# Judge status: Accepted
import collections,sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N = I()
a = sorted(LI())
deque = collections.deque()
for x in a:
    deque.append(x)
ans = 0
for _ in range(N):
    deque.popleft()
    deque.pop()
    ans += deque.pop()
print(ans)
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
A = sorted(A, reverse=True)
ans1 = 0
ans2 = 0
index = N
for i in range(N-1):
    if A[i] == A[i + 1]:
        ans1 = A[i]
        index = i + 2
        break
for j in range(index, N - 1):
    if A[j] == A[j + 1]:
        ans2 = A[j]
        flag = 1
        break

print(ans1*ans2)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

p = set()
q = 0
for i in range(n):
  if a[i] < 2800:
    p.add(a[i]//400)
  else:
    q += 1

p = len(p)
print(p, p+q)
# Judge status: Accepted
x = int(input().replace(' ', ''))
print('NO' if x%4 else 'YES')
# Judge status: Accepted
N,A,B = map(int,input().split())
print(N//(A+B)*A + min(N%(A+B),A))
# Judge status: Accepted
import numpy as np
N = int(input())
S = np.array([input() for _ in range(N)], dtype=str)
keys, values = np.unique(S, return_counts=True)
cnt = []
for k, v in zip(keys, values):
    cnt.append([k, v])
cnt.sort(reverse=True, key=lambda x: x[1])
a = cnt[0][1]
ans = []
for k, v in cnt:
    if v < a:
        break
    ans.append(k)
ans.sort()
for a in ans:
    print(a)
# Judge status: Accepted
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
ans=0
for i,j in enumerate(a):
    b.append(i+j)
    c.append(i-j)
d=Counter(c)
for i in b:
    ans+=d.get(i,0)

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
(n, ), *p = [[*map(int, i.split())] for i in open(0)]
t, x, y = 0, 0, 0
for a, b, c in p:
    d = abs(x - b) + abs(y - c) - a + t
    if d <= 0 and d % 2 < 1:
        t, x, y = a, b, c
    else:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
n,a,b = map(int, input().split())
Min, Max = a*(n-1)+b, b*(n-1)+a
print(Max-Min+1 if Max-Min+1>0 else 0)
# Judge status: Wrong Answer
import itertools

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

cnt = 0
for v in itertools.combinations(l, 3):
    t = set(v)
    print(v)
    if len(t) == len(v) and (abs(v[0] - v[1]) < v[2] < v[0] + v[1]):
        cnt += 1
print(cnt)
# Judge status: Accepted
a,b,c=map(int,input().split());print(int(a*b/2))
# Judge status: Accepted
n=input()
if n[0]=="9" or n[1]=="9":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# import itertools
# import math


def solve(N, K, H):
    H.sort(reverse=True)
    if N <= K:
        return 0

    for i in range(K):
        H[i] = 0
    return sum(H)


# N = int(input())
# S = input()
N, K = map(int, input().split())
H = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss  = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N, K, H))
# Judge status: Accepted
N, K = map(int, input().split())
h = [i for i in map(int, input().split())]
memo = [0]*N
for i in range(N):
    mini = 10**10
    for j in range(i-min(i, K), i, 1):
        if memo[j] + abs(h[i]-h[j]) < mini:
            mini = memo[j] + abs(h[i]-h[j])
    if i != 0:
        memo[i] = mini
print(memo[N-1])
# Judge status: Accepted
s=input()
def judge(s):
    for i in range(len(s)):
        if s[i]!=s[-1-i]:
            return False
    return True

if judge(s) and judge(s[:(len(s)-1)//2]) and judge(s[(len(s)+3)//2-1:]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
k = 2 *10**5
mod = 10**9+7

n, a, b = map(int,input().split())

modinv_table = [-1]*(k+1)
for i in range(1,k+1):
    modinv_table[i] = pow(i,-1,mod)

def binomial_coefficients(n,k):
    ans = 1
    for i in range(k):
        ans *= n-i
        ans *= modinv_table[i+1]
        ans %= mod
    return ans
print((pow(2,n,mod)-binomial_coefficients(n,a)-binomial_coefficients(n,b)-1)%mod)
# Judge status: Accepted
def LI():
    return list(map(int, input().split()))


S, c = LI()
if 2*S >= c:
    ans = c//2
else:
    ans = S
    c -= 2*S
    ans += c//4
print(ans)
# Judge status: Accepted
with open(0) as f:
    N, *a = map(int, f.read().split())
i, j, k = 0, 0, 0
for x in a:
    if x%4 == 0:
        i += 1
    elif x%2 == 0:
        j += 1
    else:
        k += 1
    
if j > 0:
    k += 1
print('Yes' if k <= i+1 else 'No')
# Judge status: Wrong Answer
k, x = map(int, input().split())

print('Yes') if k*500==x else print('No')
# Judge status: Accepted
n = int(input())
w = list(map(int, input().split()))
arr = []
for i in range(n):
  a = w[:i]
  b = w[i:]
  arr.append(abs(sum(a) - sum(b)))
print(min(arr))
# Judge status: Wrong Answer
n=int(input())
k=int(input())
x=int(input())
y=int(input())

if n-k>0:
    a=n-3
    b=a*y
    c=b+x*3
    print(c)
else:
    print(n*x)
# Judge status: Wrong Answer
N, M, K = map(int, input().split())
ok = False
for i in range(N + 1):
    now = M * i
    for j in range(M + 1):
        now -= j * i
        now += j * (N - i)
        if now == K:
            ok = True
if ok:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,x = map(int,input().split())
if x>=a and x<=a+b:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
H,N=map(int, input().split())
A = list(map(int, input().split()))

if(max(A) > H):
  print("Yes")
elif(sum(A) > H):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
print(['No','Yes'][input()==input()[::-1]])
# Judge status: Wrong Answer
A,B,M=map(int,input().split())
x = [0] * M
y = [0] * M
c = [0] * M
a = [0] * M
b = [0] * M
#0から入ってる
a=input().split()
b=input().split()

#ただの最小
mina=int(min(a))
minb=int(min(b))
nomal_count=mina+minb
#割引


wari_count=0
for i in range(M):
  x,y,c=map(int,input().split())
  now_count=int(a[x-1])+int(b[y-1])-c
  if nomal_count>now_count:
    wari_count=now_count
    
print(min(nomal_count,wari_count))
# Judge status: Accepted
s = list(input())
ac, bc, cc = 0, 0, 0
for i in range(len(s)):
    if s[i] == 'a':
        ac += 1
    elif s[i] == 'b':
        bc += 1
    else:
        cc += 1
if abs(ac-bc) > 1 or abs(ac-cc) > 1 or abs(bc-cc) > 1:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
a,b = map(int,input().split())
num = 100**a
ans = num*b
if b!= 100:
  print(ans)
else:
  print(ans+num)
# Judge status: Accepted
import sys

X = int(input())
i = 0

while 1:
    i += 1
    for j in range(-i+1, i):
        if i**5 - j**5 == X:
            print(i, j)
            sys.exit()
# Judge status: Accepted
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    X,Y,A,B,C = map(int,input().split())
    p = list(map(int,input().split()))
    q = list(map(int,input().split()))
    r = list(map(int,input().split()))

    p.sort(reverse=True)
    q.sort(reverse=True)

    p = p[:X]
    q = q[:Y]

    all = p + q + r

    all.sort(reverse=True)
    all = all[:X+Y]

    res = sum(all)

    print(res)



main()
# Judge status: Accepted
import bisect

n = int(input())
lstA = sorted(list(map(int,input().split())))
lstB = sorted(list(map(int,input().split())))
lstC = sorted(list(map(int,input().split())))

ans = 0
for i in range(n):
    num = lstB[i]
    top = bisect.bisect_left(lstA, num)
    btm = n - bisect.bisect_right(lstC, num)
    ans += top*btm
print(ans)
# Judge status: Wrong Answer
N, M=map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse = True)
su = 0
for i in alist:
    su += i
if alist[M-1] >= 1/(4*su):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
*a, = map(int,input().split())
g = []
M = 10**5+1
for i in range(1,M):
    g.append((i,0))
g = dict(g); s = 0
for A in a:
    g[A] += 1
    s += A
q = int(input())
for loop in range(q):
    b,c = map(int,input().split())
    if g[b] == 0:
        print(s)
        continue
    s += g[b] * (c - b)
    g[c] += g[b]
    g[b] == 0
    print(s)
# Judge status: Accepted
import math
a, b, h, m = map(int, input().split())

long = 360 * h / 12 + 360 / 12 * m / 60
short = 360 * m / 60
# long *= math.pi / 180
# short *= math.pi / 180
if True:
    theta = abs(long - short) * math.pi / 180
    B = a * math.cos(theta) - b
    A = a * math.sin(theta)
    print(math.sqrt(A*A + B*B))
# Judge status: Wrong Answer
n, k = map(int, input().split())
i = 1
while k ** i < n:
    i += 1
print(i)
# Judge status: Accepted
n = int(input())
a=[]
time=0
ans=True

for i in range(n):
    s,p=map(int,input().split())
    a+=[[s, p] ]
    

import operator as op
a.sort(key = op.itemgetter(1))

for i  in range(n):
    time+=a[i][0]
    if(time>a[i][1]):
        ans=False
        break
    
if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

p = 1000
s = 0

for i, j in zip(A, A[1:]):
  if i < j:
    d, m = divmod(p, i)
    s += d
    p = m
  elif i > j:
    p += s * i
    s = 0

if s != 0:
  p += s * A[-1]

print(p)
# Judge status: Accepted
# coding: utf-8
K,A,B=map(int,input().split())
b_count=1
b_chenge_count=0

if B-A<=2:
    b_count+=K
else:
    b_chenge_count=max(0,int((K-(A-1))/2))
    b_count=b_chenge_count*(B-A)+(A)+(K-(A-1)-b_chenge_count*2)

print(b_count)
# Judge status: Accepted
n = int(input())
s = list(input())

r = s.count('R')
g = s.count('G')
b = len(s) - r - g
ans = r*g*b

for i in range(n-2):
  for j in range(i+1,i+((n-i-1)//2)+1):
    if s[i] != s[j] and s[i] != s[2*j - i] and s[j] != s[2*j - i]:
      ans -= 1
      
print(ans)
# Judge status: Accepted
n=int(input())
c=[]
hc=0
for i in range(n):
  a=int(input())
  l,r=-1,hc
  while r-l!=1:
    t=(l+r)//2
    if c[t]<a:
      r=t
    else:
      l=t
  if r==hc:
    c.append(a)
    hc+=1
  else:
    c[r]=a
print(hc)
# Judge status: Wrong Answer
N,D=map(int, input().split())
ans=0
for _ in range(N):
  x,y=map(int, input().split())
  if x*x + y*y >= D*D:
    ans+=1
print(ans)
# Judge status: Wrong Answer
S = input()
N = (len(S))
for i in range(N+1):
 S = S[:i-1] + 'x' + S[i:]#i番目の文字をxに変える
 S = S[:N-1] + '' + S[N:]#i番目の文字をxに変える
print(S)
# Judge status: Wrong Answer
import sys


# input = sys.stdin.readline

def main():
    S = input()
    if S == "SUN":
        print(7)
    elif S == "MON":
        print(6)
    elif S =="TUE":
        print(5)
    elif S =="WEB":
        print(4)
    elif S =="THU":
        print(3)
    elif S =="FRI":
        print(2)
    else:
        print(1)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
S = input()[::-1]
l = len(S)
dp = [[0]*2 for _ in range(l+1)]
for i in range(l):
  dp[i+1][0]=min(dp[i][1]+10-int(S[i]),dp[i][0]+int(S[i]))
  dp[i+1][1]=min(dp[i][1]+10-int(S[i])-1,dp[i][0]+int(S[i])+1)
print(min(dp[-1][0],dp[-1][1]+1))
# Judge status: Accepted
a,b,m=map(int,input().split())
reizoko=list(map(int,input().split()))
renji=list(map(int,input().split()))
ans=min(reizoko)+min(renji)
for i in range(m):
    x,y,c=map(int,input().split())
    cost=reizoko[x-1]+renji[y-1]-c
    ans=min(ans,cost)
print(ans)
# Judge status: Accepted
s=input()

for i in range(len(s)):
    for j in range(len(s)-i):
        #print(s[:i],s[i+j:])
        if s[:i]+s[i+j:]=="keyence":
            print("YES")
            exit()
        
print("NO")
# Judge status: Accepted
l = list(input())
ans = list("keyence")

minus = len(l)-7

for i in range(len(l)-minus):
  l1 = l[:i]+l[i+minus:]
  
  if l1 == ans:
    print("YES")
    exit()
    
print("NO")
# Judge status: Wrong Answer
N = int(input())
nums = list(map(int, input().split()))
Q = int(input())
operations = [list(map(int, input().split())) for _ in range(Q)]

mappings = [ 0 for __ in range(10**5+1)]
answer = 0

for b, c in operations:
  mappings[b] = c

for num in nums:
  answer += mappings[num]

print(answer)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b,c,d,e=[0,0,0,0]
for i in range(1,n):
    if(a[i]>a[i-1]):
        if(d>e):
            e=d
        d=0
    else:
        d+=1
if(d>e):
    e=d
print(e)
# Judge status: Accepted
S = input()
a = len(S)
print(a*"x")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split(' ')))
ans = 0
for i in range(n):
    if i ==0 and a[0]==1:
        a[0],a[1] = a[1],a[0]
        ans += 1
        continue
    if i<n-1 and i+1 == a[i] and i+2 ==a[i+1]:
        a[i],a[i+1]  = a[i+1],a[i]
    if i+1 ==a[i] and i+1 != a[i-1]:
        a[i-1],a[i] = a[i],a[i-1]
        ans += 1
print(ans)
# Judge status: Accepted
x=int(input())
print(x+x**2+x**3)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(N-1):
    ans += a[i]
    if sum(a[i+1:]) < sum(b[i:]):
        ans += sum(b[i:])
        break
    if i == N-2:
        ans += b[-1]
if N == 1:
    print(a[0]+b[0])
else:
    print(ans)
# Judge status: Accepted
s = set(map(int, input().split()))
if len(s) == 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s=list(input())
ans='YES'
n=len(s)
for i in range(n):
  if i%2:
    if s[i]=='R': ans='NO';break
  else:
    if s[i]=='L': ans='NO';break
print(ans)
# Judge status: Accepted
import math
N,K = (int(x) for x in input().split())
p = 0
for i in range(1,N+1):
  if i < K:
    times = math.ceil(math.log2(K/i))
    p = p + (1/N)*(1/2)**times
  else:
    p = p + (1/N)
print(p)
# Judge status: Accepted
#!/usr/bin/env python3

# input = stdin.readline


def main():
  A,B = map(int,input().split())
  def primeLst(x):
    acc = []
    f = 2
    while f * f <= x:
      if x % f == 0:
        acc.append(f)
        x //= f
      else:
        f += 1
    if x != 1:
      acc.append(x)
    return acc
  a = set(primeLst(A))
  b = set(primeLst(B))
  if len(a) * len(b) == 0:
    ans = 1
  else:
    ans = len(a&b) + 1
  print(ans)
  return

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

## Library

from fractions import gcd
import math
from math import ceil,floor
import collections

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# list = list(map(int, input().split()))

S=input()

## Logic

ans=0
for i in range(0,len(S)):
    if S[i]=="1":
        ans+=1

print(ans)
# Judge status: Wrong Answer
ln = sorted(list(map(int, input().split())))
if ln[0] == ln[1] ==5 and ln[2] ==7:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
dars = n // (a+b)
amari = n % (a+b)
if amari < b:
    ans = dars*a + amari
else:
    ans = dars*a + a
print(ans)
# Judge status: Accepted
n,k,*x=map(int,open(0).read().split())
ans=float('inf')
if 0 in x:
  k-=1
  n-=1
  del x[x.index(0)]

if k==0:
  print(0)
else:
  for i in range(n-k+1):
    ans=min(ans,abs(x[i])+abs(x[i]-x[i+k-1]))
  for i in range(k-1,n):
    ans=min(ans,abs(x[i])+abs(x[i]-x[i-(k-1)]))
  print(ans)
# Judge status: Wrong Answer
def ABC172_B():
    s = input()
    t = input()

    counter=0
    for i in range(len(s)):
        if s[i] != t[i]:
            counter += 1
    if counter == len(s):
        print(counter)
    else:
        print(min(counter,len(s)-counter))

ABC172_B()
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 20:59:14 2020
"""

import sys
#import numpy as np
import itertools
sys.setrecursionlimit(10 ** 9)

N, M, Q = map(int,input().split())
abcd = [list(map(int,input().split())) for _ in range(Q)]

A = itertools.combinations_with_replacement([i for i in range(1,M)],N)

ans = 0
for l in A:
    tmp = 0
    for a,b,c,d in abcd:
        if l[b-1] - l[a-1] == c:
            tmp += d
    ans = max(ans, tmp)
print(ans)
# Judge status: Accepted
N = int(input())
judge = []
for i in range(N):
    judge.append(input())

counter = [0, 0, 0, 0]
for i in range(N):
    if judge[i] == "AC":
        counter[0] += 1
    if judge[i] == "WA":
        counter[1] += 1
    if judge[i] == "TLE":
        counter[2] += 1
    if judge[i] == "RE":
        counter[3] += 1

print("AC x " + str(counter[0]))
print("WA x " + str(counter[1]))
print("TLE x " + str(counter[2]))
print("RE x " + str(counter[3]))
# Judge status: Accepted
Q,H,S,D = map(int,input().rstrip().split(' '))
N = int(input())

one = min(S,2*H,4*Q)
two = min(D,2*one)

ans = two*(N//2)+one*(N%2)
print(ans)
# Judge status: Wrong Answer

n = int(input())
a = 0

if n % 111 == 0:
    print(n)
else:
    a = n // 111
    print(a)
    print((a+1) * 111)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
a,b = map(int,input().split())

"""
if b < 10:
    number = 10 * a + b
if 10 <= b < 100:
    number = 100 * a + b
if b == 100:
    number = 1000 * a + b
"""

number = 10 ** len(str(b)) * a + b

ans = "No"
for i in range(4, 101):
    if i ** 2 == number:
        ans = "Yes"

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

S = input()
N = int(input())
c = False
for i in range(N):
    Q = list(input().split())
    a = int(Q[0])
    if a == 1:
        c = not c
    elif a == 2:
        if c == True:
            S = S[::-1]
        b = int(Q[1])
        if b == 1:
            S = Q[2] + S
        elif b == 2:
            S = S + Q[2]
if c == True:
    S = S[::-1]
print(S)
# Judge status: Accepted
n = int(input())
l =[input() for _ in range(n)]
a=0
b=0
c=0
d=0
for i in l:
    if i == "AC":
        a += 1
    if i == "WA":
        b += 1
    if i == "TLE":
        c += 1
    if i == "RE":
        d += 1

print("AC x "+str(a))
print("WA x "+str(b))
print("TLE x "+str(c))
print("RE x "+str(d))
# Judge status: Accepted
import math

r = int(input())
ans = 2 * math.pi * r
print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())
D = B - A
if D % 2 == 0:
    print(D // 2)
else:
    print((D - 1) // 2 + min(A - 1, N - B) + 1)
# Judge status: Accepted
N, M = map(int, input().split())
l = []
for i in range(M):
  p, y = list(map(int, input().split()))
  l.append([i+1, p, y, ""])
l = sorted(l, key=lambda x: x[2])

cnt = [1]*(N+1)
for i in range(M):
  l[i][3] = str(l[i][1]).zfill(6) + str(cnt[l[i][1]]).zfill(6)
  cnt[l[i][1]] += 1

l = sorted(l, key=lambda x: x[0])
for i in range(M):
  print(l[i][3])
# Judge status: Wrong Answer
n = int(input())
a = []
for i in range(n): a.append(int(input()))

cur = 0
for i in range(10**9):
    if a[cur] == 2:
        print(cur)
        exit()
    cur = a[cur]-1
print(-1)
# Judge status: Accepted
import math
a,b=input().split()
a=int(a)
b= int(b.replace(".",""))
print(a*b//100)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
plus, minus = 0, 0
ans = 1
for i in range(n-1):
    if a[i]<a[i+1]: plus = 1
    elif a[i]>a[i+1]: minus = 1
    if plus==minus==1:
        plus, minus = 0, 0
        ans += 1
print(ans)
# Judge status: Wrong Answer
s=input()
for i in range(len(s)):
    if (i+1)%2==0:
        if s[i]=="R":
            print(i+1)
            print("No")
            exit()
    else:
        if s[i]=="L":
            print(i+1)
            print("No")
            exit()
print("Yes")
# Judge status: Wrong Answer
N = int(input())
l = []

for _ in range(N):
    a, b, c = map(int, input().split())
    l.append([a,b,c])
dp = [0]*N
choice = [-1] * N
for i in range(3):
    tmp = l[0][i]
    if tmp > dp[0]:
        dp[0] = tmp
        choice[0] = i

for i in range(1, N):
    for j in range(3):
        tmp = l[i][j] + dp[i-1]
        if tmp > dp[i] and choice[i-1] != j:
            dp[i] = tmp
            choice[i] = j
print(dp[N-1])
# Judge status: Accepted
n, m = map(int, input().split())
ab = list(list(map(int, input().split())) for _ in range(n))
cd = list(list(map(int, input().split())) for _ in range(m))

for j in range(n):
    a, b = ab[j][0], ab[j][1]
    ans, res = 0, 1001001001
    for i in range(m):
        c, d = cd[i][0], cd[i][1]
        if abs(a-c)+abs(b-d) < res:
            res = abs(a-c)+abs(b-d)
            ans = i+1
    print(ans)
# Judge status: Accepted
S = input()
ans = True
if ('S' in S) ^ ('N' in S):
    ans = False
if ('W' in S) ^ ('E' in S):
    ans = False
if ans:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())


if n == 0:
    print(1)
elif n%2 == 1:
    print(0)
else:
    answer = 0
    count = 1
    n=n/2
    while 5**count <= n:
        answer+=int(n//5**count)
        count+=1
    print(answer)
# Judge status: Accepted
from itertools import permutations

n = int(input())
*p, = map(int, input().split())

ans = 0
for j, k in enumerate(p[:-2]):
    a, b, c = k, p[j+1], p[j+2]
    if a < b < c or c < b < a:
        ans += 1

print(ans)