peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
dx = tx - sx
dy = ty - sy
print("U"*dy + "R"*dx, end="")
print("D"*dy + "L"*dx, end="")
print("L" + "U"*(dy+1) +"R"*(dx+1) +"D", end="")
print("R" + "D"*(dy+1) +"L"*(dx+1) +"U", end="")
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n==1:
  print(m-2)
elif m==1:
  print(n-2)
else:
  print(0)
# Judge status: Accepted
K, X = map(int, input().split())

print(*[i for i in range(X-K+1, X+K)])
# Judge status: Wrong Answer
if __name__ == "__main__":
  n = input()
  if '7' in n:
  	print('yes')
  else:
  	print('no')
# Judge status: Accepted
h = int(input())
w = int(input())
N = int(input())
cnt, loop = 0, 0
while cnt < N:
  cnt += max(w, h)
  loop += 1
print(loop)
# Judge status: Wrong Answer
N,D=map(int,input().split())
total=0
i=0
while N>=total:
  i+=1
  total=(2*D+1)*i
print(i)
# Judge status: Accepted
N, A, B = map(int, input().split())
ans = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x = x//10

    return count

for n in range(1, N+1):
    count = FindSumOfDigits(n)
    if A<= count <=B:
        ans += n

print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
print(sum(p[0:k]))
# Judge status: Wrong Answer
a,b=input().split()
a=int(a)
b=int(b)
print(a//(b*2+1))
# Judge status: Accepted
N=int(input())
L=[]
count=0
for i in range (N):
	L.append(input())
if len(set(L))!=N:
	print("No")
else:
	for i in range (N-1):
		if L[i][-1]!=L[i+1][0]:
			count+=1
	if count==0:
		print("Yes")
	else:
		print("No")
# Judge status: Accepted
import numpy as np

N, K = map(int, input().split())
P = 0
for p in range(1, N+1):
  i = max(0, np.ceil(np.log2(K/p)))
  P += (1/N)*(0.5**i)
  
print(P)
# Judge status: Accepted
import fractions
a,b=map(int,input().split())
k=fractions.gcd(a,b)
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    
    return arr

 
print(len(factorization(k))+1)
# Judge status: Accepted
n = int(input())
S = input()
T = S.replace('()', '')
for _ in range(50):
  T = T.replace('()', '')
print('(' * T.count(')') + S + ')' * T.count('('))
# Judge status: Accepted
A = input()
S = list(map(int,list(A)))
N = len(S)
output = 0
for i in range(N):
    t = N-1-i
    M = S[t]
    if M>5:
        output += 10-M
        S[t-1]+=1
    elif M==5:
        if S[t-1]>=5:
            output += 10-M
            S[t-1]+=1
        else:
            output+=M
    else:
        output += M
if S[0]>5:
    output+=1
if A=="5":
    output = 5
print(output)
# Judge status: Accepted
n = int(input())
s = str(n)
l = list(s)
for i in range(len(l)):
    l[i] = int(l[i])
print(max(sum(l), int(l[0])-1 + (len(l)-1)*9))
# Judge status: Wrong Answer
import math
A,B = map(int, input().split())
answerA = math.ceil(A/0.08)
answerAA = math.floor((A+1)/0.08)
answerB = math.ceil(B/0.1)
answerBB = math.floor((B+1)/0.1)
if answerA < answerB and answerAA >= answerB:
    print(answerB)
elif answerB < answerA and answerBB >= answerA:
    print(answerA)
elif answerA >= answerB and answerAA <= answerBB:
    print(answerA)
elif answerB >= answerA and answerBB <= answerAA:
    print(answerB)
else:
    print("-1")
# Judge status: Accepted
def main():
    H, N = map(int, input().split(' '))
    A = input().split(' ')
    total = 0
    for i in A:
        total += int(i)
    if total >= H:
        print('Yes')
    else:
        print('No')
main()
# Judge status: Accepted
# agc002_a.py
A, B = map(int,input().split())
if A<=0 and B>=0:
    print('Zero')
elif A>0 and B>0:
    print("Positive")
elif A<0 and B<0:
    if (A-B)%2==0:
        print("Negative")
    else:
        print("Positive")
# Judge status: Accepted
n = int(input())
a = []

for i in range(n):
    a.append(int(input()))

b = []
chain = 0
for i in range(n):
    if(chain>=1 and a[i]==0):
        b.append(chain)
        chain = 0
    elif(a[i]>=1):
        chain += a[i]
ans=0
b.append(chain)
for i in b:
    ans += i//2
    #print(i)
print(ans)
# Judge status: Wrong Answer
N,M = map(int, input().split())
if N%2==1:
  for i in range(1,M+1):
    print(i,N-i)
else:
  for i in range(1,M+1):
    print(2*i-1, N-i)
# Judge status: Accepted
def conbination_2(n):
  if n <= 1:
    return 0
  else:
    return int(n * (n - 1) / 2)


N = int(input())
A = list(map(int,input().split()))
S = 0
Count = [0] * N

for i in range(N):
  Count[A[i] - 1] += 1
  
for i in range(N):
  S += conbination_2(Count[i])
  
for i in range(N):
  Ans = S - (Count[A[i] - 1] - 1)
  print(Ans)
# Judge status: Accepted
import math
def main():
  s = input()
  flg=0
  if s[0]=='A':
    if s[2:len(s)-1].count('C')==1:
      s=s.replace('C','c')
      if s[1:].islower():
        print("AC")
        flg=1
  if flg==0:
    print("WA")
main()
# Judge status: Accepted
a,b = map(int,input().split())
print(a*b)
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())

area = int((a + b) * h / 2)
print(area)
# Judge status: Wrong Answer
A,B,C,D = map(int, input().split())
for i in range(1,201):
  while A > 0 and C > 0:
    if i%2==1:
      C=C-B*(((i-1)/2)+1)
    if i%2==0:
      A=A-D*(i/2)
  if A > 0 and C < 0:
    print('Yes')
  if A < 0 and C > 0:
    print('No')
# Judge status: Accepted
a,b,k=map(int,input().split())

if k>=b-a+1:
  for i in range(a,b+1):
    print(i)

else:
  a_set={i for i in range(a,a+k)}
  b_set={i for i in range(b-k+1,b+1)}

  ans_set = sorted(a_set | b_set)

  for i in ans_set:
    print(i)
# Judge status: Accepted
n, y = map(int, input().split())
for senyen in range(n + 1):
    for gosenyen in range(n + 1 - senyen):
        manyen = n - senyen - gosenyen
        if senyen * 1000 + gosenyen * 5000 + manyen * 10000 == y:
            print(manyen, gosenyen, senyen)
            exit(0)
print("-1 -1 -1")
# Judge status: Accepted
inputs = [int(x) for x in input().split()]
if len(set(inputs)) == 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
c = Counter(A)
a, b = 0, 0
for key in sorted(c.keys(), reverse=True):
  if c[key] >= 4:
    a = max(a, key)
    b = max(b, key)
  elif c[key] >= 2:
    if a == 0:
      a = key
    elif a != 0 and b == 0:
      b = key
print(a*b)
# Judge status: Accepted
n, m = map(int, input().split())
a = n * (n - 1) // 2
b = m*(m-1)// 2
print(a + b)
# Judge status: Wrong Answer
S = input()

lst = ['Sunny', 'cloudy', 'Rainy']

if S == lst[0]:
    print(lst[1])

elif S == lst[1]:
    print(lst[2])
else:
    print(lst[0])
# Judge status: Wrong Answer
from collections import defaultdict
n = int(input())
al = list(map(int, input().split()))


t = 0
d = defaultdict(lambda: 1)
for a in al:
    if a >= 3200:
        t += 1
    else:
        d[str(a // 400)] += 1
print(len(d), len(d)+t)
# Judge status: Wrong Answer
def gcd(a, b):
    if(a == 0):
        return b
    return gcd(b % a, a)
def lcm(a, b):
    if((a * b) / gcd(a, b) > 1000000000000000000):
        return a/(gcd(a, b) * b) 
    return (a * b) / gcd(a, b)
t = int(input())
ans = 1
while(t != 0):
    t -= 1
    n = int(input())
    ans = lcm(ans, n)
print(int(ans))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
L=sorted(A,reverse=True)
if L[0]<sum(L[1:]):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import collections
import copy

s = list(map(str,input()))
c = copy.copy(s)
c = set(c)
ans = [0]*3
tmp = collections.Counter(s)
ans[0] = tmp["a"]
ans[1] = tmp["b"]
ans[2] = tmp["c"]

if len(c) == 1:
    print("YES")
else:
    tmp = min(ans)
    if abs(ans[0])-tmp <= 1 and abs(ans[1])-tmp <= 1 and abs(ans[2])-tmp <= 1:
        print("YES")
    else:
        print("NO")
# Judge status: Wrong Answer
s = list(input())
s1 = [i for i in s]
s1[0] = "A"
s1[2] = "C"
for j in range(len(s)):
    if j != 0 or j != 2:
        s1[j] = str.lower(s1[j])
if s == s1:
    print("AC")
else:
    print("WA")
# Judge status: Wrong Answer
s1 = input()
s2 = input()
dic = {}
for i in range(len(s1)):
    if not s1[i] in dic:
        dic[s1[i]] = s2[i]
if len(dic) != len(set(dic.values())):
    print('No')
else:
    print('Yes')
# Judge status: Accepted
N,A,B = map(int,input().split())
ans=0

for i in range(0,N+1):
  keta_sum = 0
  i = str(i)
  for j in range(len(str(i))):
    keta_sum += int(i[j])
  if A <= keta_sum <= B:
    ans += int(i)

print(ans)
# Judge status: Accepted
h = int(input())

n = 0

while h >= 2 ** n:
    n += 1

print(2 ** n - 1)
# Judge status: Accepted
from sys import stdin

N = int(input())
a = list(map(int,stdin.readline().split()))

a.sort(reverse=True)

Alice = 0
for i in range(0,len(a),2):
    Alice += a[i]

Bob = sum(a)-Alice

print(Alice - Bob)
# Judge status: Accepted
from math import ceil,sqrt;s=int(input());a=ceil(sqrt(s));print(0,0,a,1,a**2-s,a)
# Judge status: Accepted
X, Y = map(int, input().split())
d = Y // X
p = 0
while d != 0:
  p += 1
  d //= 2
print(p)
# Judge status: Accepted
x,y,z=map(int,input().split())
mitumori=x//(y+z)
if x - mitumori*(y+z)>=z:print(mitumori)
else:print(mitumori-1)
# Judge status: Accepted
import numpy as np

H, N = map(int, input().split())
AB = np.array([list(map(int, input().split())) for i in range(N)])
A = AB[:, 0]
B = AB[:, 1]

# インデックスはライフ 値はそれを以下にする最小MP
dp = np.array([10**10 for i in range(H+1)], dtype=int)
# dp = np.array([np.inf for i in range(H+1)], dtype=int)
dp[0] = 0

for i in range(1, H+1):
    # print(np.maximum(i-A, 0))
    dp[i] = min(dp[np.maximum(i-A, 0)] + B)

print(dp[-1])
# Judge status: Wrong Answer
import numpy as np

A=[]
for i in range(3):
	A.append(list(map(int,input().split())))

N =  int(input())

for line in range(N):
	b=int(input())
	for a in range(3):
		for a_1 in range(3):
			if A[a][a_1]==b:
				A[a][a_1]=0
ans=[]
A_r=np.array(A).T.tolist()

for k in range(3):
	if sum(A[k])==0 or sum(A_r[k])==0:
		ans=[0,0,0]
		break
	else:
		ans.append(A[k][k])

if ans==[0,0,0]:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
#!/usr/bin/env python3

a = int(input())
b = int(input())

if a+b == 3:
    print(3)
elif a+b == 4:
    print(2)
else:
    print(1)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

n, k = map(int, input().split())
a = [int(x) for x in input().split()]
from itertools import accumulate
for i in range(k):
    temp = [0]*(n + 1)
    for j in range(n):
        b = a[j]
        left = max(0, j - b)
        right = min(n - 1, j + b)
        temp[left] += 1
        temp[right + 1] -= 1
    a = list(accumulate(temp))[:n]
    if min(a) == n:
        print(*a)
        sys.exit()
print(*a)
# Judge status: Wrong Answer
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
li = rl()
cnt = 0
for i in range(1, n-1):
  if li[i-1] < li[i] < li[i+1]:
    cnt += 1
print(cnt)
# Judge status: Accepted
x_max, y_max, N = map(int, input().split())
x_min, y_min = 0, 0
l = [[int(i) for i in input().split()] for _ in range(N)]
for i in range(N):
  if l[i][2] == 1:
    x_min = max(x_min, l[i][0])
  elif l[i][2] == 2:
    x_max = min(x_max, l[i][0])
  elif l[i][2] == 3:
    y_min = max(y_min, l[i][1])
  elif l[i][2] == 4:
    y_max = min(y_max, l[i][1])
if x_max-x_min > 0 and y_max-y_min:
  print((x_max-x_min)*(y_max-y_min))
else:
  print(0)
# Judge status: Accepted
n=int(input())
s=input()

r=s.count("R")
g=s.count("G")
b=s.count("B")

tmp=r*g*b

for i in range(n):
    for dist in range(n):
        j=i+dist
        k=j+dist
        if k>=n: break
        if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
            tmp-=1

print(tmp)
# Judge status: Accepted
N, K = map(int, input().split())
X = list(map(int, input().split()))
a= []
for i in range(N-K+1):
    l = X[i]
    r = X[i+K-1]
    a.append(min(abs(l)+abs(r-l), abs(r) + abs(r-l)))
print(min(a))
# Judge status: Accepted
'''
ID: essi
LANG: PYTHON3
TASK: ‌D.py
''' 
# edge between x and y make the way.
# for every pair of vertix we have two way if x <= j
n, x, y = map(int,input().split())
k = [0] * n
k[0] = n # nothing
for i in range(1, n):
	for j in range(i + 1, n + 1):
		if x > j:
			k[j - i]+= 1
		else:
			way = abs(i-x) + 1 + abs(y-j)
			#way = min(abs(i-y) + 1 + abs(x-j), way)
			k[min(j - i, way)]+= 1	
for i in range(1, n):
	print(k[i])
# Judge status: Accepted
N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [10**6] * 100005
dp[0] = 0
# dp[1] = abs(h[1]-h[0])
for i in range(1, N):
    dp[i] = min(dp[i-j] + abs(h[i-j] - h[i]) for j in range(1,min(K,i)+1))
    # print([dp[i-j] + abs(h[i-j] - h[i]) for j in range(1,min(K,i)+1)])
    # for j in range(1, min(K,i)+1):
    #     dp[i] = min(dp[i], dp[i-j] + abs(h[i-j] - h[i]))

print(dp[N-1])
# Judge status: Accepted
N, M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
CD = [list(map(int,input().split())) for _ in range(M)]
def dist(AB, CD):
  return abs(AB[0]-CD[0]) + abs(AB[1]-CD[1])

for i in range(N):
  d = 10**18; ans = -1;
  for j in range(M):
    tmp = dist(AB[i], CD[j])
    if tmp < d:
      d = tmp; ans = j+1;
  print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split())

if a > b:
    print(0)
elif n == 1 and a != b:
    print(0)
else:
    print((b * (n-1) + a) - (a * (n-1) + b) + 1)
# Judge status: Accepted
import itertools
N,M,Q = list(map(int,input().split()))
list1 = [None for i in range(Q)]
for i in range(Q):
  list1[i] = list(map(int,input().split()))

ans = 0
for x in itertools.combinations_with_replacement(range(1,M+1),N):
  score = 0
  x1 = sorted(x)
  score = sum(y[3] for y in list1 if x1[y[1]-1]-x1[y[0]-1] == y[2])
  if score > ans:
    ans = score

print(ans)
# Judge status: Accepted
K=int(input())
i=1
if K%2==0 or K%5==0:
  print(-1)
elif K%7==0:
  L=9*K/7
  b=10
  while True:
    b=b%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
else:
  L=9*K
  b=10
  while True:
    b=b%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
# Judge status: Accepted
# coding: utf-8
a, b = input().split()
a = int(a)
b = float(b) * 1000
b = int(b)
print(int((a * b) // 1000))
# Judge status: Wrong Answer
import math

N, D = map(int, input().split())
X = []
cnt = 0
for i in range(N):
    X.append(list(map(int, input().split())))
for i in range(1, N):
    for j in range(i):
        d = 0
        for k in range(D):
            d += (X[i][k] - X[j][k])**2
        for l in range(d):
            if l**2 == d:
                cnt += 1
                break
print(cnt)
# Judge status: Accepted
n, m = [int(x) for x in input().split()]
a = set([int(input()) for _ in range(m)])

dp = [0]*(n+1)
dp[0] = 1

for i in range(1, n+1):
    dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7)
    if i in a:
        dp[i] = 0

print(dp[n])
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(a*b*0.5)
# Judge status: Wrong Answer
a,b,c,x,y=map(int,input().split())
sum=0
if a+b>=2*c:
  sum+=2*c*min(x,y)
  x-=min(x,y)
  y-=min(x,y)
  if x==0:
    if b>=2*c:
      sum+=2*c*y
    else:
      sum+=b*y
  elif y==0:
    if a>=2*c:
      sum+=2*c*x
    else:
      sum+=a*x
else:
  sum+=a*x+b*y
print(sum)
# Judge status: Accepted
# vim: fileencoding=utf-8


def main():
    n = int(input())
    li = list(map(int, input().split()))
    max = 0
    total = 0
    for i in li:
        if max < i:
            max = i
            continue
        elif max == i:
            continue
        else:
            total += max - i
    print(total)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n,m = list(map(int, input().split()))
a = list(map(int, input().split()))
a1 = [[1,i] for i in a]
bc = [list(map(int, input().split())) for _ in range(m)]
abc = a1+bc
abc.sort(key=lambda x:x[1])
abc.reverse()

ans = 0
n1 = n+0
for x,y in abc:
    if n1 >x:
        ans += x*y
        n1 -= x
    else:
        ans += n1*y
        break

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = "APPROVED"
for x in a:
  if (x % 2 == 0):
    if (x % 3 != 0 and x % 5 != 0):
      ans = "DENIED"
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
 
if a<=c<=b:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s = list(input())
t = list(input())
for i in range(len(s)):
    if s == t:
        print("Yes")
        exit()
    else:
        a = s.pop(-1)
        s.insert(0, a)
print("No")
# Judge status: Accepted
S = input()
if S == "RRR":
  print(3)
elif S == "RRS" or S == "SRR":
  print(2)
elif S == "SSS":
  print(0)
else:
  print(1)
# Judge status: Wrong Answer
n=int(input())
a=input()
con=0
ans=n
for i in range(n):
  if i==ans:
      break
  if a[i]=="W":
    con+=1
    while ans>=0:
      ans-=1
      if i==ans:
        print(con)
        exit()
      if a[ans]=="R":
        break  
print(con)
# Judge status: Accepted
n = int(input())
a = []
for i in range(1000):
         a.append(i ** 5)
for i in range(1000):
         for j in range(-1000,1000):
                  if (a[i]) - (j ** 5) == n:
                           print(i,j)
                           exit()
# Judge status: Accepted
a=int(input())
b=input()
c=0
d=0
for i in range(a):
  if b[i]=="D":
    c=c-1
  if b[i]=="I":
    c=c+1
  if c>d:
    d=c
print(d)
# Judge status: Wrong Answer
import math
a, b, c = (int(x) for x in input().split())
sqr_a = math.sqrt(a)
sqr_b = math.sqrt(b)
sqr_c = math.sqrt(c)
if (sqr_a+sqr_b) < sqr_c:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    d, t, s = rli()
    if t*s >= d:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c=map(int,input().split())
if (a<c and c<b) or (b<c and c<a):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
x = input()
s = 0
t = 0
for i in range(len(x)):
    if x[i] == "T":
        s = max(0, s-1)
    else:
        s += 1
    if x[-i-1] == "S":
        t = max(0, t -1)
    else:
        t += 1
print(s+t)
# Judge status: Accepted
pi = 3.14159
r = int(input())
print(2*r*pi)
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split(" ")]
Min = float("inf")
index = 0
L = 0
R = sum(A)
for i in range(0,len(A)):
    L+=A[i]
    R-=A[i]
    diff = abs(L - R)
    if diff < Min:
        Min = diff
print(Min)
# Judge status: Wrong Answer
N, K, S = map(int,input().split())

if K==0:
    list = [0 for i in range(N)]
    print(*list)
elif K==N:
    list = [S for i in range(N)]
    print(*list)
else:
    ans = [S for a in range(K)]
    ain = [S+1 for a in range(N-K)]
    ans = ans + ain
    print(*ans)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
border = H[N-1]

ans = True
for i in range(N-2, -1, -1):
    if H[i] <= border:
        border = H[i]
    else:
        if H[i] - 1 <= border:
            border = H[i] - 1
        else:
            ans = False

if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
D,N = [int(i) for i in input().split()]
print(N*100**D if N != 100 else (N+1)*100**D)
# Judge status: Accepted
x = input()
x = "T" + x + "S"
ar = []
c = 1
for i in range(1, len(x)):
    if x[i-1] == x[i]:
        c += 1
    else:
        ar.append(c)
        c = 1
ar.append(c)

ssum = ar[1]
trem = ar[0]
for i in range(2, len(ar), 2):
    trem += max(0, ar[i]-ssum)
    ssum -= min(ssum, ar[i])
    ssum += ar[i+1]
print(ssum+trem-2)
# Judge status: Accepted
x=int(input())
for i in range(-120,121):
  for j in range(-120,121):
    if pow(i,5)-pow(j,5)==x:
      print(i,j);exit()
# Judge status: Accepted
from bisect import *
S = list(str(input()))
K = int(input())

alp = list("abcdefghijklmnopqrstuvwxyz")

for i in range(len(S)):
  b = bisect_left(alp,S[i])

  if i == len(S)-1:
    S[i] = alp[(b+K)%26]
  elif b == 0:
    continue
  elif 26 - b <= K:
    K -= (26 - b)
    S[i] = "a"
  if K == 0:
    break
  
print("".join(S))
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))

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

for i in range(a,b+1):
    if (i%k == 0):
        print("OK")
        exit()

print("NG")
# Judge status: Accepted
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
max_ = max(c.values())
c = sorted([k for k, v in c.items() if v == max_])
for a in c:
    print(a)
# Judge status: Accepted
s = input()
s = s.replace('eraser', '')
s = s.replace('erase', '')
s = s.replace('dreamer', '')
s = s.replace('dream', '')
if len(s) == 0:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
a = [input().split() for _ in range(3)]
n = int(input())
for _ in range(n):
    b = input()
    cnt = -1
    for i in a:
        cnt+=1
        if b in i:
            pos = i.index(b)
            a[cnt][pos] = "0"

bingo = ["0","0","0"]
for i in a:
    if a == bingo:
        print("Yes")
        exit()
if a[0][0] == a[1][1] == a[2][2] == "0" or a[0][2] == a[1][1] == a[2][0] == "0":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())

res = 0
for i in range(1, N + 1):
  y = N // i
  res += ((1 + y) * y * i) // 2

print(res)
# Judge status: Wrong Answer
H1, M1, H2, M2, K = map(int, input().split())
kh, km = K//60, K%60
H2 -= kh
M2 -= km
if M2 < 0:
    M2 += 60
    H2 -= 1
    
H2 -= H1
M2 -= H1
if M2 < 0:
    M2 += 60
    H2 -= 1

    
print(H2 * 60 + M2 + 10)
# Judge status: Accepted
n,k=map(int,input().split())
z=1
for i in range(1,n+1):
  x=k/i
  cnt=0
  while x>1:
    cnt+=1
    x/=2
  if cnt!=0:
    z-=(1/n)*(1-1/(2**cnt))
print(z)
# Judge status: Accepted
import heapq  # heapqライブラリのimport
N,M=map(int,input().split())
A = list(map(int,input().split()))
for j in range(N):
 A[j]*=-1
heapq.heapify(A)  # リストを優先度付きキューへ
for i in range(M):
 c=heapq.heappop(A)
 c=((-c)//2)
 heapq.heappush(A, -c)
print(-sum(A))
# Judge status: Accepted
S = input()
a = (len(S) - 1) // 2
b = (len(S) + 3) // 2 - 1
if S == S[::-1] and S[:a] == S[:a][::-1] and S[b:] == S[b:][::-1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N=int(input())
s=str(input())
t=str(input())
c=0
tmp=0
S=list(s)
T=list(t)
for i in range(N):
    if s[N-i-1:N]==t[0:i+1]:
        c=i+1
    #print(s[N-i-1:N],t[0:i+1])
#print(c)
print(2*N-c)
# Judge status: Wrong Answer
n,k = map(int,input().split())
l = list(map(int,input().split()))
curr_town = 1

for i in range(k) :
    temp = l[curr_town - 1]
    curr_town = l[temp - 1]

print(curr_town + 1)
# Judge status: Accepted
A,B,K = list(map(int,input().split()))
s = set()
for i in range(0,K):
    s.add(A+i)
for i in range(0,K):
    s.add(B-i)
l = sorted(filter(lambda x: A <= x <=B,list(s)))
for i in l:
    print(i)
# Judge status: Accepted
# A - Fifty-Fifty

s = str(input())
ans = 'Yes'

for i in range(len(s)):
    if s.count(s[i])!=2:
        ans = 'No'
        break

print(ans)
# Judge status: Wrong Answer
def main(a, b, c, k):
    for _ in range(k + 1):
        if a >= b:
            b *= 2
        elif b >= c:
            c *= 2

        if a < b < c:
            print("Yes")
            return

    print("No")


if __name__ == "__main__":
    a, b, c = map(int, input().split())
    k = int(input())

    main(a, b, c, k)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    a[i]-=1
ans=0
flg=True
for i in range(1,n):
    if a[i]==i and a[i-1]==i-1 and flg:
        if flg:
            ans-=1
            flg=False
        else:
            flg=True
for i in range(n):
    if a[i]==i:
        ans+=1
print(ans)