Harryxun/stf_run huggingface dataset:
a,b,c,d = map(int,input().split())
if (abs(b-a) <= d and abs(c-b) <= d) 
	print('Yes')
else if (abs(c-a)<= d)
	print('Yes')
else
	print('No')

### FIXED CODE ###

a,b,c,d = map(int,input().split())
if abs(b-a) <= d and abs(c-b) <= d:
	print('Yes')
elif abs(c-a)<= d:
	print('Yes')
else:
	print('No')
mod=10**9+7
from math import sqrt
n=int(input())

A=list(map(int,input().split()))
N=[0]*(10**3+1)
def soi(n):
    cnt_2=0
    while n%2==0:
        n//=2
        cnt_2+=1
    N[2]=max(N[2],cnt_2)
    for j in range(3,int(sqrt(n))+1,2):
        cnt_j=0
        while n%j==0:
            n//=j
            cnt_j+=1
        N[j]=max(N[j],cnt_j)
    if n!=1:
        N[n]=max(N[n],1)

for i in range(n):
    soi(A[i])
L=1
for i in range(1,10**3+1):
    L*=((i)**(N[i]))%mod
ans=0
for i in range(n):
    ans+=(L*pow(A[i],mod-2,mod))%mod
print(ans)

### FIXED CODE ###

from fractions import gcd

def lcm(a,b):
    return a*(b//gcd(a,b))

mod=10**9+7

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

L=A[0]
for i in range(1,n):
    L=lcm(L,A[i])
L%=mod

coef=sum(pow(x,mod-2,mod) for x in A)
print(L*coef%mod)
N = int(input())
C = list(map(int, input().split()))
C.sort()

ans = 0
mod = 10**9 + 7

for l in range(N):
    r = N - l - 1
    ans += C[l] * (pow(2, r-1, mod) * r + pow(2, r, mod)) * pow(2, l, mod)

print(int(ans * pow(2, N, mod)) % mod)




### FIXED CODE ###


N = int(input())
C = list(map(int, input().split()))
C.sort()

ans = 0
mod = 10**9 + 7

for l in range(N):
    r = N - l - 1
    if r > 0:
        ans += C[l] * (pow(2, r-1, mod) * r + pow(2, r, mod)) * pow(2, l, mod)
    else:
        ans += C[l] * (pow(2, r, mod)) * pow(2, l, mod)
        
print(int(ans * pow(2, N, mod)) % mod)
n = int(input())

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

s = 1
t = 0

for i in range(n):
	if s == a[i]:
      s += 1
    else:
      t +=1
      
if t != n:
  print(t)
else:
  print(-1)
  

### FIXED CODE ###

n = int(input())
renga = list(map(int,input().split()))
 
next = 1
ans = 0
 
for i in range(n):
    if next == renga[i]:
        next += 1
    else:
        ans += 1
if ans == n:
    ans = -1
print(ans)
import sys

A, B, C, X, Y = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5]
A = int(A)
B = int(B)
C = int(C)
X = int(X)
Y = int(Y)

strat1 = A*X + B*Y  # simple strategy
strat2 = 2*C*X + abs(Y-X)+B  # more A, add back B
strat3 = 2*C*Y + abs(X-Y)*A  # more B, add back A
strat4 = 2*C*max(X,Y) # overbuy C

print min(strat1, strat2, strat3, strat4)


### FIXED CODE ###

A, B, C, X, Y = map(int, raw_input().split())

strat1 = A*X + B*Y  # simple strategy
strat2 = 2*C*X + abs(Y-X)*B  # more A, add back B
strat3 = 2*C*Y + abs(X-Y)*A  # more B, add back A
strat4 = 2*C*max(X,Y) # overbuy C

print min(strat1, strat2, strat3, strat4)
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

# import math
# import numpy as np
# import copy
# from collections import defaultdict, Counter
# from itertools import product
# from bisect import bisect_left, bisect_right
def inpl(): return list(map(int, input().split()))

S = list(input())
N = len(S)
while True:
    flag = False
    for i in range(1, len(S)-2):
        l = S[i-1]
        mid = S[i:i+2]
        r = S[i+2]
        if mid == ["0", "1"] or mid == ["1", "0"]:
            if (l == "0" and r == "1") or (l == "1" and r == "0"):
                del S[i:i+2]
                i += 2
                flag = True
                if i >= len(N)-3:
                    break


    if flag:
        continue

    nN = len(S)
    for i in range(0, len(S)-1):
        mid = S[i:i+2]
        if mid == ["0", "1"] or mid == ["1", "0"]:
            del S[i:i+2]
            i += 2
            if i >= len(nN)-2:
                break

    break
print(N-len(S))

### FIXED CODE ###

# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

# import math
# import numpy as np
# import copy
# from collections import defaultdict, Counter
# from itertools import product
# from bisect import bisect_left, bisect_right
def inpl(): return list(map(int, input().split()))

S = input()
N = len(S)
c0 = S.count("0")
c1 = S.count("1")

print(2*min(c0, c1))
n=int(input())
count=0
for i in range(1,n+1):
    if i%2==1:
        yakusuu=0
        for j in range(1,int((i**0.5)//1)+1):
            if i%j==0:
                if j**2==i:
                    yakusuu+=1
                else:
                    yakusuu+=2
        if yakusuu==8:
            count+=1
print(count)

### FIXED CODE ###

s=list(map(str,input()))
l=[[]]
count=0
for i in s:
    if i=='A' or i=='C' or i=='G' or i=='T':
        l[count].append(i)
    else:
        count+=1
        l.append([])
maxl=0
for j in l:
    if len(j)>maxl:
        maxl=len(j)
print(maxl)
H,W=map(int,input().split())
S=[input().split() for i in range(H)]
columns=["A","B","C","D","E","F","G","H"]
for h in range(H):
    for w in range(W):
        if S[h][w]=="snuke":
            print(columns[w]+str(h+1))

### FIXED CODE ###

H,W=map(int,input().split())
S=[input().split() for i in range(H)]
columns="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for h in range(H):
    for w in range(W):
        if S[h][w]=="snuke":
            print(columns[w]+str(h+1))
X = [0 for i in range(2**N)]
Y = [0 for i in range(2**N)]
Z = [0 for i in range(2**N)]

for i in range(2**N):
    select = []
    if i > 0:
        temp = i
        for n in reversed(range(1, N+1)):
            if temp - 2**(n-1) >= 0:
                temp = temp - 2**(n-1)
                select.append(n-1)
            else:
                pass
        X[i] = sum([V[i] for i in select])
        Y[i] = sum([C[i] for i in select])
        Z[i] = X[i] - Y[i]
print(max(Z))

### FIXED CODE ###

N = int(input())
V = [int(x.strip()) for x in input().split()]
C = [int(x.strip()) for x in input().split()]

Z = [V[i] - C[i] for i in range(N)]
print(sum([z for z in Z if z > 0]))
import sys
import os
import itertools

n = int(input())

def is_prime(n):
    for p in range(2, n):
        if n % p == 0:
            return p, n//p
        else:
            return 0, 0

a, b = is_prime(n)
if a:
    print((a-1)+(b-1))
else:
    print(n-1)

### FIXED CODE ###

import sys
import os
import itertools

n = int(input())

def make_divisors(n):
    divisors = {}
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors[i] = n//i
            if i != n // i:
                divisors[i] = n//i

    return divisors

ans = make_divisors(n)
m = max(ans)
print( (m-1) + ans[m]-1)
def binarySearch(list_a, key):
    left = 0
    right = len(list_a)
    while left < right:
        mid = (left + right) // 2
        if list_a[mid] == key:
            return mid
            break
        elif key < list_a[mid]:
            right = mid
        else:
            left = mid+1
    else:
        return "NOT_FOUND"

def merge(list_a, left, mid, right):
    import math
    n1 = mid - left
    n2 = right - mid
    list_l = []
    list_r = []
    for i in range(0,n1):
        list_l.append(list_a[left + i])
    for i in range(0,n2):
        list_r.append(list_a[mid + i])
    list_l.append(math.inf)
    list_r.append(math.inf)
    i = 0
    j = 0
    for k in range(left,right):
        if list_l[i] <= list_r[j]:
            list_a[k] = list_l[i]
            i += 1
        else:
            list_a[k] = list_r[j]
            j += 1

def mergeSort(list_a, left, right):
    if left + 1 < right:
        mid = (left + right) //2
        mergeSort(list_a, left, mid)
        mergeSort(list_a, mid, right)
        merge(list_a, left, mid, right)


n = int(input())
list_d = list((map(int, input().split())))
m = int(input())
list_t = list((map(int, input().split())))

mergeSort(list_d, 0, n)
for number in list_t:
    ind = binarySearch(list_d, number)
    if ind != "NOT_FOUND":
        del list_d[ind]
    else:
        print("NO")
        break
else:
    print("YES")


### FIXED CODE ###

n = int(input())
list_d = list((map(int, input().split())))
m = int(input())
list_t = list((map(int, input().split())))

dict_d = {}
dict_t = {}
for number in set(list_d):
    dict_d[number] = 0
for number in set(list_t):
    dict_d[number] = 0
for number in list_d:
    dict_d[number] += 1

for number in set(list_t):
    dict_t[number] = 0
for number in list_t:
    dict_t[number] += 1

for number,value in dict_t.items():
    if dict_d[number] < value:
        print("NO")
        break
    else:
        pass
else:
    print("YES")
r,g,b,n = map(int, input().split())
count = 0
c1,c2,c3 = sorted([r,g,b])
for i in range(1+n//c2):
    for j in range(1+n//c1):
        rest = n - i*c2 - j*c1
        if rest%c0 == 0 and rest >= 0:
            count += 1
print(count)

### FIXED CODE ###

r,g,b,n = map(int, input().split())
count = 0
c0,c1,c2 = sorted([r,g,b])
for i in range(1+n//c2):
    rest1 = n - i*c2
    if rest1 < 0:
        break
    for j in range(1+rest1//c1):
        rest = n - i*c2 - j*c1
        if rest <0:
            break
        elif rest%c0 == 0:
            count += 1
print(count)
def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    Y = (s - 1) // X + 1
    while Y <= k:
        xy = X * Y - s
        lim = min(Y, int(xy ** 0.5))
        for y in range(1, lim + 1):
            x, m = divmod(xy, y)
            if x <= X and m == 0:
                return 0, 0, X, y, x, Y
        Y += 1


s = int(input())
print(*solve(s))


### FIXED CODE ###

def solve(s):
    k = 10 ** 9
    if s <= k:
        return 0, 0, 1, 0, 0, s
    X = k
    while True:
        Y = (s - 1) // X + 1
        while Y <= k:
            xy = X * Y - s
            if xy == 0:
                return 0, 0, X, 0, 0, Y
            lim = min(Y, int(xy ** 0.5))
            for y in range(1, lim + 1):
                x, m = divmod(xy, y)
                if x <= X and m == 0:
                    return 0, 0, X, y, x, Y
            Y += 1
        X -= 1


s = int(input())
print(*solve(s))
_, k, s = map(int, open(0).read().split())
s[k-1] ==chr(ord(s[k-1])+26)
print(s)

### FIXED CODE ###

k = int(input()[2:])
s = list(input())
s[k-1] = chr(ord(str(s[k-1])) + 32)
print("".join(s))
a,b,c,d = str(input())

if 1<=int(a+b)<=12 and 1<=int(c+d)<=12:
  print("AMBIGUOUS")
elif 1<=int(a+b)<=12 
  print("MMYY")
elif 1<=int(c+d)<=12 
  print("YYMM")
else:
  print("NA")


### FIXED CODE ###

a,b,c,d = str(input())

if 1<=int(a+b)<=12 and 1<=int(c+d)<=12:
  print("AMBIGUOUS")
elif 1<=int(a+b)<=12: 
  print("MMYY")
elif 1<=int(c+d)<=12: 
  print("YYMM")
else:
  print("NA")
import math
n = int(input())
r = list()
for a in range(1,int(math.sqrt(n))):
    if n % a == 0:
        b = n//a
        r.append(a+b-2)
print(min(r))

### FIXED CODE ###

import math
n = int(input())
r = list()
for a in range(1,int(math.sqrt(10**12)+1)):
    if n % a == 0:
        b = n//a
        r.append(a+b-2)
print(min(r))
a = int(input())
b = a%10
print(b)
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
  print("hon")
elsif b == 0 or b == 1 or b == 6 or b == 8:
   print("pon")
else:
  print("bon")


### FIXED CODE ###

a = int(input())
b = a%10
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
  print("hon")
elif b == 0 or b == 1 or b == 6 or b == 8:
   print("pon")
else:
  print("bon")
s,t = input().sprit()
a=0
for i in range(0,len(s)):
  if s[i]==t[i]:
    a=a+1
  else:
    a=a+0
print(a)

### FIXED CODE ###

s,t = input(), input()
a = 0
for i in range(len(s)):
    if s[i]!=t[i]:
        a = a + 1
print(a)
from collections import deque
n, m = map(int, input().split())

a = [0] * (m + 1)
b = [0] * (m + 1)
road = [[] for _ in range(m + 1)]

for i in range(m):
    a[i], b[i] = map(int, input().split())
    road[a[i]].append(b[i])
    road[b[i]].append(a[i])

ans = [-1] * (n + 1)
ans[0] = 0
ans[1] = 0

q = deque()
q.appendleft(1)

while len(q):
    i = q.pop()
    for j in road[i]:
        if ans[j] == -1:
            ans[j] = i
            q.appendleft(j)

if ans.count(-1) != 0:
    print("No")
    exit()
else:
    print("Yes")
    print(*ans[2:], sep="\n")



### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())

a = [0] * (m + 1)
b = [0] * (m + 1)
road = [[] for _ in range(n + 1)]

for i in range(m):
    a[i], b[i] = map(int, input().split())
    road[a[i]].append(b[i])
    road[b[i]].append(a[i])

ans = [-1] * (n + 1)
ans[0] = 0
ans[1] = 0

q = deque()
q.appendleft(1)

while len(q):
    i = q.pop()
    for j in road[i]:
        if ans[j] == -1:
            ans[j] = i
            q.appendleft(j)

if ans.count(-1) != 0:
    print("No")
    exit()
else:
    print("Yes")
    print(*ans[2:], sep="\n")
import sys
input=sys.stdin.readline

s=input()
ans=0

for i in range(2 ** (len(s)-1)):
  bin_i = bin(i)[2:].rjust(len(s)-1,"0")
  li=[]
  n=s[0]
  #0がなし、1が+
  for ix,sign in enumerate(bin_i):
    if sign=="0":
      n+=s[ix+1]
    else:
      li.append(int(n))
      n=s[ix+1]
  li.append(int(n))
  ans+=sum(li)

print(ans)

### FIXED CODE ###

s=input()
ans=0

if len(s)==1:
  print(s)
  exit()

for i in range(2 ** (len(s)-1)):
  bin_i = bin(i)[2:].rjust(len(s)-1,"0")
  li=[]
  n=s[0]
  for ix,sign in enumerate(bin_i):
    if sign=="0":
      n+=s[ix+1]
    else:
      li.append(int(n))
      n=s[ix+1]
  li.append(int(n))
  ans+=sum(li)

print(ans)
from sys import stdin
input = stdin.readline

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

m = X % D
l = X // D

if l > K:
    print(abs(abs(X) - D * K))
else:
    if (K - l) % 2 == 0:
        print(m)
        exit(1)
    else:
        print(D - m)


### FIXED CODE ###

from sys import stdin
input = stdin.readline

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

X = abs(X)

m = X % D
l = X // D

if l > K:
    print(abs(X) - D * K)
else:
    if (K - l) % 2 == 0:
        print(m)
    else:
        print(D - m)
Sa, Sb, Sc = open(0).read().split()
#print(Sa, Sb,Sc)
numSa = len(Sa)
numSb = len(Sb)
numSc = len(Sc)
i=j=k=0
flgA = True
flgB = flgC = False
while(True):
    if flgA == True:
        flgA = False
        if Sa[i] == "a":
            i+=1
            flgA = True
        elif Sa[i] == "b":
            j+=1
            flgB = True
        else:
            k+=1
            flgC = True
    elif flgB == True:
        flgB = False
        if Sb[j] == "a":
            i+=1
            flgA = True
        elif Sb[j] == "b":
            j+=1
            flgB = True
        else:
            k+=1
            flgC = True
    elif flgC == True:
        flgC = False
        if Sc[k] == "a":
            i+=1
            flgA = True
        elif Sc[k] == "b":
            j+=1
            flgB = True
        else:
            k+=1
            flgC = True
    else:
        pass
    
    if numSa==i:
        print("A")
        break
    elif numSb==j:
        pritn("B")
        break
    elif numSc==k:
        print("C")
        break
    else:
        pass

### FIXED CODE ###

Sa, Sb, Sc = open(0).read().split()
# print(Sa, Sb,Sc)
numSa = len(Sa)
numSb = len(Sb)
numSc = len(Sc)
# print(numSa,numSb,numSc)
i=j=k=0
flgA = True
flgB = flgC = False
l=0
# noDebug = False
while(True):
    if flgA == True:
#         print("A",i)
        flgA = False
        if numSa==i:
             print("A")
#             noDebug = True
             break
        if Sa[i] == "a":
            flgA = True
        elif Sa[i] == "b":
            flgB = True
        else:
            flgC = True
        i+=1
    elif flgB == True:
#         print("B",j)
        flgB = False
        if numSb==j:
            print("B")
#             noDebug = True
            break
        if Sb[j] == "a":
            flgA = True
        elif Sb[j] == "b":
            flgB = True
        else:
            flgC = True
        j+=1
    elif flgC == True:
#         print("C",k)
        flgC = False
        if numSc==k:
            print("C")
#             noDebug = True
            break
        if Sc[k] == "a":
            flgA = True
        elif Sc[k] == "b":
            flgB = True
        else:
            flgC = True
        k+=1
    else:
        pass
#     if noDebug == False:
#         print(l)
#         print(l,"::",Sa[i],i,Sb[j],j,Sc[k],k) 
#     l+=1
n=int(input())
a=list(map(int,input().split()))
if n%2==0:
    b=sorted(a)
    i=0
    while i<len(b)-2:
        if b[i]!=b[i+1] or b[i+2]!=b[i]+2:
            print(0)
            exit()
        i+=2
    print((2**(len(b)//2))%(10**9+7))
else:
    b=sorted(a)
    if b[0]!=0 or b[1]==0:
        print(0)
        exit()
    else:
        i=1
        while i<len(b)-2:
            if b[i]!=b[i+1] or b[i+2]!=b[i]+2:
                print(0)
                exit()
            i+=2
        print(2**(len(b)//2)%(10**9+7))



### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
if n%2==0:
    b=sorted(a)
    i=0
    while i<len(b):
        if not (b[i]==b[i+1] or b[i+2]==b[i]+2):
            print(0)
            exit()
        i+=2
    print((2**(len(b)//2))%(10**9+7))
else:
    b=sorted(a)
    if len(b)>1:
        if b[1]==0:
            print(0)
            exit()
    if b[0]!=0:
        print(0)
        exit()
    else:
        i=1
        while i<len(b):
            if not (b[i]==b[i+1] or b[i+2]==b[i]+2):
                print(0)
                exit()
            i+=2
        print(2**(len(b)//2)%(10**9+7))
n = int(input())
a = []
for num in range(n):
  a.append(int(input()))

for num in range(n):
  temp = a.copy()
  del temp[num]
  print(max(temp))

### FIXED CODE ###

n = int(input())
a = []
first = 0
second = 0
for num in range(n):
	hoge = int(input())
	a.append(hoge)
	if hoge >= first:
		second = first
		first = hoge
	elif second <= hoge and hoge <= first:
		second = hoge

#print(first, second)
for num in range(n):
	if(first <= a[num]):
		print(second)
	else:
		print(first)
a, b = map(int, raw_imput().split())

 if a < b:
  print 'a < b' 
 elif a == b:
  print 'a == b'
 elif a > b:
  print 'a > b'

### FIXED CODE ###

a, b = map(int, raw_input().split())
 
if a < b:
 print "a < b"
elif a > b:
 print "a > b"
elif a == b:
 print "a == b"
n, m = map(int, input().split())
prefers = [list(reversed(list(map(int, input().split())))) for _ in range(n)]
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]

for i, ps in enumerate(prefers):
    item = ps[-1]
    competes[item] += 1
    persons[item].add(i)

ans = m
remain = m
while remain:
    mx = max(competes.values())
    ans = min(ans, mx)
    del_items = [a for a, k in competes.items() if k == mx]
    for a in del_items:
        items[a] = False
        del competes[a]
    for a in del_items:
        pa = persons[a]
        for p in pa:
            pf = prefers[p]
            while not items[pf[-1]]:
                pf.pop()
            item = pf[-1]
            persons[item].add(p)
            competes[item] += 1
    remain -= 1

print(ans)


### FIXED CODE ###

from collections import defaultdict
from operator import itemgetter


def sub(prefers, canceled):
    res = defaultdict(int)
    for pref in prefers:
        p = pref[-1]
        while p in canceled:
            pref.pop()
            p = pref[-1]
        res[p] += 1

    return max(res.items(), key=itemgetter(1))


def solve(m, prefers):
    canceled = set()
    ans = float('inf')
    for _ in range(m):
        s, c = sub(prefers, canceled)
        canceled.add(s)
        ans = min(ans, c)
    return ans


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

print(solve(m, prefers))
today = input()
if today == Sunny:
  tomorrow = Cloudy
elif today == Cloudy:
  tomorrow = Rainy
else:
  tomorrow = Sunny
print(tomorrow)

### FIXED CODE ###

today = input()
if today == 'Sunny':
  tomorrow = 'Cloudy'
elif today == 'Cloudy':
  tomorrow = 'Rainy'
else:
  tomorrow = 'Sunny'
print(tomorrow)
import math

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

multipled = A * B
floored = math.floor(multipled)

print(floored)


### FIXED CODE ###

import math

A, B = list(input().split())
A = int(A)

# A *= 100
# B = float(B)
# B = math.floor(B * 100)
B = B.replace('.', '').ljust(3, '0')
B = int(B)

# AB = A * B / 100
# floored = int(math.floor(AB))
# print(floored)

AB = A * B
AB = str(AB)
AB = AB[0:-2]
AB = 0 if AB == '' else AB
print(AB)
s = input()

ans = []
flag = 0

#print(s)
#print(s[0])

for i in range(len(s)):
    if flag == 0:
        if s[i] == "A":
            flag = 1
            ans.append(s[i])

    else:
        if s[i] == "Z":
            if i > len(s) - 1 or s[i+1] != "Z":
                flag = 0
                ans.append(s[i])
                break
            
            else:
                ans.append(s[i])

        else:
            ans.append(s[i])
        

#print(ans)

#print("".join(ans))

print(len(ans))


### FIXED CODE ###

s = input()

flag = 0

a = 200000
z = 0

for i in range(len(s)):
    if s[i] == "A" and a > i:
        a = i

    elif s[i] == "Z" and z < i:
        z = i

print(z - a + 1)
# coding: utf-8
# Your code here!

import itertools

N = int(input())
ta = [list(map(int,input().split())) for _ in range(N)]
for Cx, Cy in itertools.product(range(101),range(101)):
    # もしcx,cyが決まっていた場合矛盾が起こらないか
    # H = abs(x-cx)+abs(y-cy) + h
    H = None
    for [x,y,h] in ta:
        if h == 0:
            pass
        else:
            if H is None:
                H = h + abs(x-Cx)+abs(y-Cy)
            else:
                if H != h + abs(x-Cx)+abs(y-Cy):
                    break
        if h != max(H - abs(x-Cx) - abs(y-Cy),0):
            break
    else:
        break
print(Cx,Cy,H)


### FIXED CODE ###

# coding: utf-8
# Your code here!

import itertools

N = int(input())
ta = [list(map(int,input().split())) for _ in range(N)]
for Cx, Cy in itertools.product(range(101),range(101)):
    # もしcx,cyが決まっていた場合矛盾が起こらないか
    # H = abs(x-cx)+abs(y-cy) + h
    H = None
    for [x,y,h] in ta:
        if h == 0:
            pass
        else:
            if H is None:
                H = h + abs(x-Cx)+abs(y-Cy)
            else:
                if H != h + abs(x-Cx)+abs(y-Cy):
                    break
    for [x,y,h] in ta:
        if h != max(H - abs(x-Cx) - abs(y-Cy),0):
            break
    else:
        break
print(Cx,Cy,H)
from sys import stdin

H, W = [int(x) for x in stdin.readline().rstrip().split()]

A = [list(stdin.readline().rstrip()) for _ in range(H)]
result = A

delete_column = []
delete_row = []

for k in range(W):
    cnt = 0
    for l in A[k]:
        if l == '.':
            cnt += 1
    if cnt == len(A[k]):
        delete_row.append(k)

for k in range(W):
    cnt = 0
    for l in range(H):
        if A[l][k] == '.':
            cnt += 1
    if cnt == H:
        delete_column.append(k)

for x in delete_row:
    del result[x]

for x in delete_column:
    for y in range(len(A)):
        del result[y][x]

for x in result:
    print(''.join(x))

### FIXED CODE ###

from sys import stdin
 
N, i = [int(x) for x in stdin.readline().rstrip().split()]
 
print(N + 1 - i)