peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def main():
    n = int(input())
    n -= 1
    
    s = []
    for _ in range(15):
        # print(n)
        s.append(chr(ord('a')+(n%26)))
        n = int(n / 26)
        if n==0:
            break
        n -= 1
    s.reverse()
    print(''.join(s))

    pass

main()
# Judge status: Wrong Answer
n,a,b=map(int,input().split())
s = input()

cnt_s = 0
cnt_b = 0

for i in range(n):
    if cnt_s <= a+b and i == 'a':
        print('Yes')
        cnt_s += 1
    elif cnt_s > a+b and i == 'a':
        print('No')
    elif cnt_s <= a+b and cnt_b <= b and i =='b':
        print('Yes')
        cnt_b += 1
        cnt_s += 1
    else:
        print('No')
# Judge status: Wrong Answer
arr=raw_input()
ans="No"
for i in range(2):
  if arr[i]==9:
    ans = "Yes"
    break
print ans
# Judge status: Accepted
a, b, c, k = map(int, input().split())
print(a - b if k % 2 == 0 else b - a)
# Judge status: Accepted
N = int(input())

AC,WA,TLE,RE = 0,0,0,0

for i in range(N):
    S = input()
    if(S == 'AC'):
        AC += 1
    if(S == 'WA'):
        WA += 1
    if(S == 'TLE'):
        TLE += 1
    if(S == 'RE'):
        RE += 1

print('AC x {}'.format(AC))
print('WA x {}'.format(WA))                    
print('TLE x {}'.format(TLE))
print('RE x {}'.format(RE))
# Judge status: Wrong Answer
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    s=STR()
    temp=(int(s[0])+1)*3
    ct=int(temp)-int(s)
    if 0<=ct<=110:
        print(temp)
    else:
        temp=s[0]*3
        print(temp)
    
    
if __name__ == '__main__':
    do()
# Judge status: Wrong Answer
x=int(input())
if ((x%100)*5)>x//100:
	print(0)
else:
	print(1)
# Judge status: Wrong Answer
seq=input()
c=0
for i in range(3):
  if seq[i]==1:
    c+=1
print(c)
# Judge status: Accepted
bingo = [list(map(int,input().split())) for i in range(3)]
n= int(input())
bs = [int(input()) for i in range(n)]

bingo.append([bingo[0][0], bingo[1][1], bingo[2][2]])
bingo.append([bingo[0][2], bingo[1][1], bingo[2][0]])
bingo.append([bingo[0][0], bingo[1][0], bingo[2][0]])
bingo.append([bingo[0][1], bingo[1][1], bingo[2][1]])
bingo.append([bingo[0][2], bingo[1][2], bingo[2][2]])


print("Yes" if any([len([j for j in k if j in bs])==3 for k in bingo]) else "No")
# Judge status: Accepted
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    pos = 0
    neg = 0
    for i in range(N):
        pos += max(a[i]-b[i],0)
        neg += abs(min(a[i]-b[i],0))//2
    if  neg >= pos:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()
# Judge status: Accepted
card_dict = {}

card_dict['a'] = input()
card_dict['b'] = input()
card_dict['c'] = input()

turn = 'a'

while True:
    if not card_dict[turn]:
        print(turn.upper())
        break
    next_turn = card_dict[turn][0]
    card_dict[turn] = card_dict[turn][1:]
    turn = next_turn
# Judge status: Accepted
n = int(input())
ans = []
for i in range(1,10):
    for j in range(1, 10):
        ans.append(i * j)
if n in ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# AtCoder Beginner Contest 175
# C - Walking Takahashi

X,K,D =map(int,input().split())

X=abs(X)

q=X//D
r=X%D

if K<=q:
    print(X-K*D)
    exit()

else :
    if (K-q)%2==0:
        print(r)
    else :
        print(abs(r-D))
# Judge status: Accepted
import math
print(math.ceil(eval(input().replace(" ","+"))/2))
# Judge status: Wrong Answer
l, r, d = map(int,input().rstrip("\n").split(" "))

answer = (r // d) - (l // d)

print(answer)
# Judge status: Accepted
a,b,c = (int(x) for x in input().split())
if b-a == c-b:
  print ('YES')
else:
  print ('NO')
# Judge status: Wrong Answer
N = int(input())
A,B,X = [0]*N,[0]*N,[0]*N
for i in range(N):
    A[i],B[i] = map(int,input().split())
if N%2 == 1:
    ans = B[int((N-1)/2)] - A[int((N-1)/2)] + 1
elif N%2 == 0:
    ans = B[int(N/2)] + B[int(N/2)-1] - A[int(N/2)] - A[int(N/2)-1] + 1
print(ans)
# Judge status: Accepted
def main():
    A, B = map(int, input().split())
    cnt = 0
    for i in range(A, B+1):
        s = str(i)
        t = list(s)
        t.reverse()
        if s == ''.join(t):
            cnt += 1
    print(cnt)

if __name__ == "__main__":
    main()
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
path="R"*(tx-sx) + "U"*(ty-sy) + "L"*(tx-sx) + "D"*(ty-sy) + "D" + "R"*(tx-sx+1) + "U"*(ty-sy+1) + "L" + "U" + "L"*(tx-sx+1) + "D"*(ty-sy+1) + "R"
print(path)
# Judge status: Wrong Answer
a = input()
a = a.split()
a = list(map(lambda x: int(x),a))

sum = 1
for i in a:
    sum *= i
if sum % 2 == 0:
    print("odd")
else:
    print("Even")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
di1 = {}
di2 = {}
for i, j in enumerate(a):
    if i-j in di1:
        di1[i-j] += 1
    else:
        di1[i-j] = 1
    if i+j in di2:
        di2[i+j] += 1
    else:
        di2[i+j] = 1

ans = 0
for i, j in di1.items():
    if i not in di2:
        continue
    ans += di2[i]*j
print(ans)
# Judge status: Accepted
import statistics

N = int(input())
A = []
B = []
for i in range(N):
    a,b = map(int, input().split())
    A.append(a)
    B.append(b)

medA = statistics.median(A)
medB = statistics.median(B)

if N % 2 == 1:
    print(medB - medA+1)
else:
    print(int((medB - medA)*2) + 1)
# Judge status: Accepted
N, M = map(int, input().split())
for i in range(1, M+1):
    if N % 2 == 1:
        print(i, N+1-i)
    else:
        if i <= N//4:
            print(i, N+1-i)
        else:
            print(i, N-i)
# Judge status: Accepted
n = int(input())
a = list(sorted(map(int,input().split())))[::-1]
ans = 0
for x in range(1,n):
    ans += a[x//2]
print(ans)
# Judge status: Wrong Answer
n=int(input())
p=input().split()
ans=0
for i in range(1,n-1):
    if p[i+1]>p[i]>p[i-1] or p[i-1]>p[i]>p[i+1]:
        ans+=1
print(ans)
# Judge status: Wrong Answer
N = int(input())
S = input()

max_num = 0
idx = 0
x = 0
while idx < N - 1:
    if S[idx] == 'I':
        x += 1
    else:
        x -= 1
    max_num = max(x, max_num)
    idx += 1

print(max_num)
# Judge status: Wrong Answer
N_List = list(map(int,input().split()))
N_List.append(N_List.pop(0))
print(" ".join(map(str,N_List)))
# Judge status: Accepted
a, b = list(map(int, input().split()))

x = 1
n = 0
while x < b:
    n += 1
    x += (a-1)
    
print(n)
# Judge status: Accepted
n = int(input())
lst = [int(i) for i in input().split()]
lst = sorted(lst)
count = 0
ans = 0
if n % 2 == 0:
    c = n//2
else:
    c = n//2+1
while count < c:
    if count == 0:
        num = lst.pop(-1)
        ans += num
    else:
        num = lst.pop(-1)
        ans += num * 2
    count += 1
if n % 2 == 1:
    ans -= num
print(ans)
# Judge status: Accepted
import sys
import math

input = sys.stdin.readline

def can(arr, m, K):
  need = 0
  for x in arr:
    if x > m:
      need += int(x // m)
  return need <= K

N, K = map(int, input().split())
arr = list(map(int, input().split()))

lo = 1
hi = int(1e9) + 1

while (lo < hi):
  m = int((lo + hi) // 2)
  if (can(arr, m, K)):
    hi = m
  else:
    lo = m + 1
print(lo)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
d = {}
e = {}
cnt = 0
for i in range(1, n+1):
    d[i] = B[i-1]
for i in range(1, n):
    e[i] = C[i-1]
for i in range(n):
    cnt += d[A[i]]
    if i != 0:
        if A[i] == 1:
            continue 
        else:
            if A[i] == A[i-1] + 1:
                cnt += C[A[i]-2]
print(cnt)
# Judge status: Accepted
from sys import exit
N, M, K  = map(int, input().split())
if K == 0:
    print("Yes")
    exit()
for n in range(N + 1):
    for m in range(M + 1):
        if (N - n) * (M - m) + n * m == K:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    h = list(map(int, input().split()))
    INF = 10**12
    dp = [INF] * (N+1)
    dp[1] = 0
    for i in range(1,N):
        dp[i+1] = min(dp[i+1],dp[i]+abs(h[i-1]-h[i]))
        if i < N-1:
            dp[i+2] = min(dp[i+2],dp[i]+abs(h[i-1]-h[i+1]))
    print(dp[N])

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
A, B, T = map(int, input().split())
tc = 0
n = 0
cnt = 0

if A >= T:
    pass
else:
    while tc < T + 0.5:
        n += B
        cnt += 1
        tc += cnt*A

print(n)
# Judge status: Wrong Answer
def actual(k):
    x, y = divmod(k, 2)
    
    return int(x * y)

k = int(input())
print(actual(k))
# Judge status: Accepted
n=int(input())
if n<=9:
  print(n)
else:
  n=str(n)
  x=n[0]
  x=int(x)-1
  if n[1:].count('9')==len(n)-1:
    print(x+1+(len(n)-1)*9)
  else:
    print(x+(len(n)-1)*9)
# Judge status: Wrong Answer
ma=input()
mb=input()
mc=input()
mdic={"a":ma,"b":mb,"c":mc}
m="a"
ndic={"a":0,"b":-1,"c":-1}
while ndic[m]<len(mdic[m]):
  print(m,ndic[m])
  m=mdic[m][ndic[m]]
  ndic[m]+=1
print(m.upper())
# Judge status: Accepted
n,m,q=map(int,input().split())
abcd=[list(map(int,input().split()))for _ in range(q)]
ans=0
import itertools
for i in itertools.combinations_with_replacement(list(range(m)),n):
  anss=0
  for a,b,c,d in abcd:
    if i[b-1]-i[a-1]==c:anss+=d
  ans=max(ans,anss)
print(ans)
# Judge status: Wrong Answer
n, w = map(int, input().split())

if n==1:
    print(w-2)
elif w==1:
    print(n-2)
elif n==2 or w==2:
    print(0)
else:
    print((n-2)*(w-2))
# Judge status: Accepted
# ABC 158: B – Count Balls
N, A, B = [int(s) for s in input().split()]

blues = A * (N // (A + B))
remains = N % (A + B)

if remains < A:
    blues += remains
elif A <= remains < A + B:
    blues += A

print(blues)
# Judge status: Accepted
array = list(map(int, input().split()))
print(array[2], array[0], array[1])
# Judge status: Accepted
a = int(input())
b = int(input())
for i in range(1,4):
    if i != a and i!=b:
        print(i)
# Judge status: Accepted
n = int(input())
ans = []
if n == 0:
    print(0)
    exit()
for i in range(10**5):
    if n == 0:
        break
    if n%pow(2,i+1) != 0:
        ans.append('1')
        n -= pow(-2,i)
    else:
        ans.append('0')
    

ans = ans[::-1]
ans_s = ''.join(ans)
print(ans_s)
# Judge status: Accepted
x, y = map(int, input().split())
mod = 1000000007
m = (x+y)//3
a = (m + x-y)//2
if (x+y)%3 != 0 or a<0 or a>m:
  print(0)
else:
  ans = 1
  for i in range(1, a+1):
    ans *= (m-a+i)*pow(i, mod-2, mod)
    ans %= mod
  print(ans)
# Judge status: Accepted
n=int(input())
s=input()
w,r=0,0
for i in range(n):
    if s[i]=='W': w+=1
    else : r+=1
c=0
for i in range(r):
    if s[i]=='R': c+=1
print(r-c)
# Judge status: Wrong Answer
a,b,k=map(int,input().split())
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
A = divisor(a)
B = divisor(b)
c = list(set(A) & set(B))
print(c[-k])
# Judge status: Wrong Answer
N=int(input())
P_list=input().split()
count=0
for i in range(len(P_list)):
    shortlist = P_list[0:i+1]
    if min(shortlist)== shortlist[i]:
        #print(shortlist)
        count+=1
print(count)
# Judge status: Accepted
n = int(input())

dic = {}

for i in range(n):
  word = input()
  if word not in dic:
    dic[word] = 1
  else:
    dic[word] += 1
    
max_num = max(dic[word] for word in dic)
l = []
for word in dic:
  if dic[word]==max_num:
    l.append(word)
    
l = sorted(l)
for i in range(len(l)):
  print(l[i])
# Judge status: Accepted
n = int(input())
A, B = [], []
for _ in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
result = 0
for a, b in zip(A[::-1], B[::-1]):
    piyo = (a+result) % b
    if piyo == 0:
        continue
    result += b - piyo
print(result)
# Judge status: Wrong Answer
n = int(input())
a = list(input().split())
a = [int(s) for s in a]
a.append(0)
money = 1000
kabuka = 0
kabu = 0
for i in range(n):
    if a[i] < a[i+1]:
        kabu = money // a[i]
        money = money - a[i]*kabu 
        kabuka = a[i]
        
    if a[i] > kabuka:
        money = money + a[i]*kabu
        kabu = 0
 
print(money)
# Judge status: Wrong Answer
w,h,x,y=map(int,input().split())
ma=w*h/2
W=x//2
H=y//2
if W%2==0 and H%2==0 and W==x and H==y:
    boo=1
else:
    boo=0

print(ma,boo)
# Judge status: Wrong Answer
S = input()
T = ""
L = len(S)
for i in range(L):
    T += S[L-i-1]
print(T)
ans = 0
for i in range((L+1)//2):
    if S[i] != T[i]:
        ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
for i in range(n):
    for j in range(n):
        if i * 4 + j * 7 == n:
            print("Yes")
            exit(0)
print("No")
# Judge status: Accepted
n, x, y = map(int, input().split())
dists = [0 for i in range(n+1)]

for i in range(1, n+1):
  for j in range(i+1, n+1):
    dist = min(abs(j-i), 1 + abs(x-i)+abs(y-j), 1 + abs(y-i)+abs(x-j))
    dists[dist]+=1
    
for i in range(1, n):
  print(dists[i])
# Judge status: Accepted
d,n = map(int,input().split())
if d == 0:
  if n==100:
    print(101)
  else:
    print(n)
else:
  if n==100:
    print(100**d*(n+1))
  else:
    print(100**d*n)
# Judge status: Wrong Answer
X = int(input())
t = 1
for t in range(1,X):
  total = t*(t+1)/2
  if total>=X:
    break
print(t)
# Judge status: Wrong Answer
n = int(input())
W = [input() for i in range(n)]
flg = 1

Word = [W[0]]
for i in range(2,n):
    s = W[i-1]
    t = W[i]
    
    if(s[-1] != t[0] or t in Word): 
        flg = 0
        break
    Word.append(t)
    
if (flg): print("Yes")
else: print("No")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

K, S = map(int, input().split())
count = 0

for x in range(0, K+1):
    for y in range(0, K+1):
        for z in range(0, K+1):
            print(x, y, z)
            if x + y + z == S:
                count += 1

print(count)
# Judge status: Accepted
import heapq as hp

N, M = map( int, input().split() )
L = [[]] * M

for i in range( N ):
  a, b = map( int, input().split() )
  if a - 1 < M:
    if L[ a - 1 ] == []:
      L[ a - 1 ] = [ b ]
    else:
      L[ a - 1 ].append( b )
      
ret = 0
C = []
hp.heapify( C )
for i in range( M ):
  for i in L[i]:
    hp.heappush( C, -i)
  if C != []:
    ret -= hp.heappop( C )

print( ret )
# Judge status: Accepted
n,a,b = map(int,input().split())
res=0

for i in range(1,n+1):
    sum=0
    for j in list(str(i)):sum+=int(j)
    if a <= sum <= b:res+=i

print(res)
# Judge status: Wrong Answer
N, a, b = map(int, input().split())
MOD = 10**9+7
z = pow(2, N)-1
xa = ya = 0
for i in range(a):
  xa *= N-i
  xa = xa%MOD 
  ya *= a-i
  ya = ya%MOD
za = (xa*(pow(ya, MOD-2)%MOD))%MOD
xb = yb = 0
for j in range(b):
  xb *= N-i
  xb = xb%MOD
  yb *= a-i
  yb = yb%MOD
zb = (xb*(pow(yb, MOD-2)%MOD))%MOD
print(z-za-zb)
# Judge status: Accepted
s = {i:list(input()) for i in 'abc'}
x = 'a'
while s[x]:
  x = s[x].pop(0)
print(x.upper())
# Judge status: Accepted
a, b, c = map(int, input().split())
abc = []
R, B = 0, 0
abc.append(a)
abc.append(b)
abc.append(c)
abc.sort()
R = abc[0] * abc[1] * (abc[2]//2)
B = a*b*c-R
print(B - R)
# Judge status: Wrong Answer
N,M=map(int,input().split())
A = list(map(int,input().split()))
import numpy as np
import math
import fractions
import functools
A = np.array(A)
A = np.unique(A)
B = A.copy()
x=0
while np.all(B%2==0):
  B//=2
  x+=1
if np.any(B%2==0):
  print(0)
  exit()
  
A /= 2
n = A[0]
for a in A[1::]:
  n = n*a//fractions.gcd(n,a)
ans = math.ceil(M/n/2)
  

print(ans-1)
# Judge status: Accepted
n, m = map(int, input().split())
a = set([])

n = [0] * 10 ** 5
ac, wa = 0, 0
for i in range(m):
    p, s = input().split()
    p = int(p)
    if p not in a:
        if s == "WA":
            n[p] += 1
        else:
            a.add(p)
            ac += 1
            wa += n[p]
print(ac, wa)
# Judge status: Accepted
a,b,c=map(int,input().split())
print(max(0,b+c-a))
# Judge status: Wrong Answer
a, b = map(int, input().split())
A = int(str(a) * b)
B = int(str(b) * a)
nlist = (A, B)
newlist = sorted(nlist)
if A != B:
    print(newlist[0])
else:
    print(A)
# Judge status: Accepted
a, b, t = map(int, input().split())
print(t//a*b)
# Judge status: Wrong Answer
H,N=map(int,input().split())

sum = 0
1<=H<=10**9
1<=N<=10**4


import random

for i in range(1,N+1):
    attack = random.randint(1,10**5)
    print(attack)

    sum += attack

total = sum

if H - total <= 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
X,Y = map (int, input ().split ())
if X < Y:
  print (X)
elif X == Y:
  print (-1)
else:
  if X%Y == 0:
    print (-1)
  else:
    print (X)
# Judge status: Accepted
#!/usr/bin/env python

s = int(input())
mod = 10**9+7

if s == 1 or s == 2:
    print(0)
    exit()
if s == 3 or s == 4 or s == 5:
    print(1)
    exit()

dp = [0 for _ in range(s+1)]
dp[0] = dp[1] = dp[2] = 0 
dp[3] = dp[4] = dp[5] = 0 

for i in range(s+1):
    for j in range(i-3, 2, -1):
        dp[i] += dp[j]
    dp[i] += 1

ans = dp[s]%mod
print(ans)
# Judge status: Accepted
def main():
  [n, k] = [int(i) for i in input().split()]
  [r, s, p] = [int(i) for i in input().split()]
  T =  input()
  
  my = T.replace("r", "hoge").replace("s", "r").replace("p", "s").replace("hoge", "p") 
  for i in range(k, n):
    if my[i] == my[i-k]:
      my = my[:i] + "l" + my[i+1:]  

  print(my.count("r")* r + my.count("s")*s + my.count("p")* p)
  
if __name__ == "__main__":
  main()
# Judge status: Accepted
N = int(input())
T = []
for _ in range(N-1):
    c,s,f = map(int,input().split())
    T.append([c,s,f])
for i in range(1,N):
    t =0
    for j in range(i-1,N-1):
        c,s,f = T[j]
        if t <=s: t =s+c
        elif t%f==0: t += c
        else: t += f -(t%f) + c
    print(t)

print(0)
# Judge status: Accepted
# 2020/08/22
# AtCoder Beginner Contest 176 - A
import math

# Input
n, x, t = map(int,input().split())

# Calc
ans = math.ceil((n / x)) * t

# Output
print(ans)
# Judge status: Accepted
S = input()
if S.count("hi") == len(S)/2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
A, B = map(int, input().split())
if A <= 5:
  print(0)
elif A <= 12:
  print(B//2)
else:
  print(B)
# Judge status: Accepted
import math
import sys
import numpy as np

def int_input():
    return map(int, input().split())

n, k = int_input()

ans = 0
for i in range(1, n + 1):
    tmp = 0
    while i * 2 ** tmp < k: tmp += 1
    ans += (1 / n) * 0.5 ** tmp
print(ans)
# Judge status: Accepted
x, y = map(int, input().split())

ans = 0
while x <= y:
    x *= 2
    ans += 1

print(ans)
# Judge status: Wrong Answer
import math
from functools import reduce

def gcd(*args):
    return reduce(math.gcd, args)

n, x = map(int, input().split())
city = list(map(int, input().split()))

distance = []
for c in city:
    distance.append(c- x)

print(gcd(*distance))
# Judge status: Wrong Answer
n=int(input())
a=[int(input()) for _ in range(n)]
for i in range(n):
    num=max(a)
    if a.index(num)==i:
        aa=sorted(a)
        print(a[-2])
    else:
        print(num)
# Judge status: Accepted
N,M = map(int, input().split())

lm,rm = 0,N
for i in range(0,M):
    l,r = map(int,input().split())
    lm = max(lm,l)
    rm = min(rm,r)
print(rm - lm + 1 if rm >= lm else 0)
# Judge status: Wrong Answer
a = input()
if a.count("7")>0:
	print("YES")
else:
	print("NO")
# Judge status: Accepted
N,K = map(int,input().split())
if N % K == 0:
	print(0)
else:
	print(1)
# Judge status: Wrong Answer
x,y = list(map(int, input().split()))
if x%y==0:
    print(x)
else:
    print(-1)
# Judge status: Accepted
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left



A,B=map(int, input().split())
if A == B:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def gcd_cnt(n):
    sub = 0
    for i in range(1, n+1):
        kosuu = n//i
        sub+=kosuu*(2*i + (kosuu-1)*i)//2
    return sub

n = int(input())
sub = gcd_cnt(n)
print(sub)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if abs(c-a) <= d :
    print("Yes")
elif abs(b-a) <= d and abs(c-b) <= d :
    print("Yes")
else :
    print("No")
# Judge status: Accepted
def main():
    s = input()
    nagasa = len(s)

    for i in range(nagasa):
        if i % 2 == 0 and s[i] == "L":
            print("No")
            exit()
        elif i % 2 != 0 and s[i] == "R":
            print("No")
            exit()
    print("Yes")

    
    
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
n,m = map(int,input().split())

li = [True] * n

a = 1 + m
if m % 2 == 0:
    for i in range(m//2):
        print(1+i, a-i)
    for i in range(m//2):
        print(a+1+i, a+m-i)

else:
    for i in range((m+1)//2):
        print(1+i, a-i)
    for i in range(m//2):
        print(a+1+i, a+m-i)
# Judge status: Accepted
n, m = map(int, input().split())
cnt = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    cnt[a-1] += 1
    cnt[b-1] += 1
for i in range(n):
    print(cnt[i])
# Judge status: Accepted
n, k = map(int, input().split())
S = input()
h = 0
for i in range(1,n):
    if S[i]==S[i-1]:
        h += 1
print(min(h+2*k, n-1))
# Judge status: Accepted
n = int(input())
a = 0
l = list(map(int, input().split()))
for i in range(n):
  if i % 2 == 0:
    if l[i] % 2 != 0:
      a = a + 1
print(a)
# Judge status: Accepted
N=int(input())
S=set()
for _ in range(N):
  S.add(input())
print(len(S))
# Judge status: Accepted
S = input()
L = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]

ans = 7 - L.index(S)

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

cnt_1 = 0
for i in a:
    if i % 2 != 0:
        cnt_1 += 1

cnt_2 = 0
for i in a:
    if i % 2 == 0 and i % 4 != 0:
        cnt_2 += 1

cnt_4 = 0
for i in a:
    if i % 4 == 0:
        cnt_4 += 1

if cnt_4 * 2 >= cnt_1 and cnt_2 % 2 == 0 or cnt_4 * 2 >= cnt_1 + cnt_2 % 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s=input()
if (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())
x = max(a,b,c)
# a=b=cにするために足さないといけない数y
y = (x-a) + (x-b) + (x-c)

if y&1:
    # yが奇数なら+3して偶数にする
    y += 3
ans = y//2
print(ans)
# Judge status: Wrong Answer
N= [int(input()) for n in range(4)]
print(N[0]*N[2]+(N[0]-N[1])*N[3])
# Judge status: Wrong Answer
N=int(input())
def prime(n):
  cnt=0
  for i in range(2,n):
    if n%2==0:
      cnt+=1
    
  return cnt
      
ans=0
for i in range(1,N+1):
  if prime(i)==8:
    ans+=1
print(ans)
# Judge status: Accepted
K = int(input())

oddNum = int((K + 1) / 2)
evenNum = int(K/2)

print(oddNum * evenNum)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
num = 0
mi = 10**9
for i in range(n):
    num += abs(a[i])
    if abs(mi) >= abs(a[i]):
        mi = a[i]
cnt = 0
for i in range(n):
    if a[i] < 0:
        cnt += 1
if cnt%2 == 1:
    print(num-2*abs(mi))
else:
    print(num)
# Judge status: Accepted
a, b, k = map(int, input().split())
if a > b:
    a, b = b, a
div_lst = []
for i in range(1, a+1):
    if a % i == 0 and b % i == 0:
        div_lst.append(i)
# print(div_lst)
print(div_lst[-k])
# Judge status: Accepted
n, m = map(int, input().split())
h = list(map(int,input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]

good = [True]*n
for route in ab:
    a = route[0]-1
    b = route[1]-1
    if h[a] > h[b]:
        good[b] = False
    elif h[b] > h[a]:
        good[a] = False
    else:
        good[a] = False
        good[b] = False
print(len(list(filter(lambda x: x, good))))
# Judge status: Accepted
n = int(input())

c = ['z','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']

k = 1
n1 = n

while n1-26**k>0:
	n1 = n1-26**k
	k+=1

ans = ''

ans = c[n1%26]+ans

for i in range(k-1):
	if n1%26!=0:
		n1 = n1//26+1
	else:
		n1 = n1//26
	ans = c[n1%26]+ans

print(ans)