Harryxun/stf_run huggingface dataset:
import numpy as np
#A = np.array([int(i) for i in input().split()])
#A = [int (x) for x in input().split()]
#N=int(input())

N=int(input())
A=[int (x) for x in input().split()]
p=[0]*N
for i in range(N-1):
    p[A[i]-1]+=1
for i in range(N):
    print(int(p[i]))

### FIXED CODE ###

N=int(input())
A=[int (x) for x in input().split()]
p=[0]*N
for i in range(N-1):
    p[A[i]-1]+=1
for i in range(N):
    print(int(p[i]))
inputs = list(map(str,input().split()))

a = int(inputs[2])
b= int(inputs[3])

if inputs[4] == inputs[0]:
  a = a - 1
elif inputs[4] == inputs[1]:
  b = b - 1

print("{0} {1}".format(a, b))

### FIXED CODE ###

import sys

msg = sys.stdin.readlines()
lines = list()

for item in msg:
    if " " in item:
        s, t = item.split()
        lines.append(s)
        lines.append(t)
    else:
        item = item.replace('\n','')
        lines.append(item)

a = int(lines[2])
b = int(lines[3])

if lines[4] == lines[0]:
    a = a - 1
elif lines[4] == lines[1]:
    b = b - 1

print("{0} {1}".format(a, b))
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

if v<=w:
    print("NO")
else:
    if abs(b-a)<=(v-w)
    if abs(b-a)%(v-w)==0 and abs(b-a)//(v-w)<=t:
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

if v<=w:
    print("NO")
else:
    if abs(b-a)<=t*(v-w):
        print("YES")
    else:
        print("NO")
# 配るDP
N, A = map(int, input().split())
X = list(map(int, input().split()))

dp = [[[0 for _ in range(３０１０)] for __ in range(N+1)] for ___ in range(N+1)]

dp[0][0][0] = 1

for i in range(N):
    for j in range(N):
        for k in range(2500+1):
            dp[i+1][j][k] += dp[i][j][k]
            dp[i+1][j+1][k+X[i]] += dp[i][j][k]

ans = 0
for n in range(1, N+1):
    ans += dp[N][n][n*A]

print(ans)


### FIXED CODE ###

# 配るDP
N, A = map(int, input().split())
X = list(map(int, input().split()))

dp = [[[0 for _ in range(3010)] for __ in range(N+1)] for ___ in range(N+1)]

dp[0][0][0] = 1

for i in range(N):
    for j in range(N):
        for k in range(2500+1):
            if dp[i][j][k]:
                dp[i+1][j][k] += dp[i][j][k]
                dp[i+1][j+1][k+X[i]] += dp[i][j][k]

ans = 0
for n in range(1, N+1):
    ans += dp[N][n][n*A]

print(ans)
n = int(input())
a = [list(input()) for i range(n)]
cnt = 0
cnt_A=0
cnt_B=0
cnt_C=0
for i in range(n):
  if "AB" in a[i]:
    cnt+= 1
for i in range(n):
  if a[i][-1] == "A" and a[i][0] =="B":
    cnt_C+=1  
  elif a[i][-1] == "A": 
    cnt_A +=1
  elif a[i][0] =="B":
    cnt_B+=1

print(cnt+cnt_A+cnt_B+cnt_C)


### FIXED CODE ###

n=int(input())
ans=0
a=0;b=0;ab=0
for i in range(n):
  s=input()
  ans+=s.count("AB")
  if s[0]=="B":
    b+=1
    if s[-1]=="A":
      ab+=1
      b-=1
  elif s[-1]=="A":
    a+=1
if a+b==0:
    print(ans+max(ab-1,0))
else:
    print(ans+min(a,b)+ab)
import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**5)

def rec(n, a, seen):
	if seen[n-1]:
		return -1
	if a[n-1] == 2:
		return seen.count(True) + 1
	seen[n-1] = True
	return rec(a[n-1], a, seen)

def resolve():
	n = int(input())
	a = []
	seen = [False]*n
	for _ in range(n):
		a.append(int(input()))
	print(rec(1, a, seen))
resolve()

### FIXED CODE ###

import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**6)

def rec(n, a, seen):
	if seen[n-1]:
		return -1
	if a[n-1] == 2:
		return seen.count(True) + 1
	seen[n-1] = True
	return rec(a[n-1], a, seen)

def resolve():
	n = int(input())
	a = []
	seen = [False]*n
	for _ in range(n):
		a.append(int(input()))
	print(rec(1, a, seen))
resolve()
a = input()
b = input()
c = input()
s = set([a, b, c])
print len(s)

### FIXED CODE ###

a,b,c = map(int, raw_input().split())
s = set([a, b, c])
print len(s)
import sys
sys.setrecursionlimit(10 ** 7)
edges = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    edges[a - 1].append((b - 1, i))
    edges[b - 1].append((a - 1, i))
l = [0 for i in range(n)]
def dfs(cur, x):
    res = 1
    for i in edges[cur]:
        if i[1] != x:
            res += dfs(i[0], i[1])
    l[x] = res
    return res
dfs(0, -1)
l2 = [1]
i2 = pow(2, mod - 2, mod)
for i in range(n):
    l2.append(l2[-1] * i2 % mod)
cnt = 0
for i in l:
    cnt += (1 - l2[i]) * (1 - l2[n - i])
print((-n * i2 - l2[-1] + cnt + 1) % mod)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
mod = 10 ** 9 + 7
n = int(input())
edges = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    edges[a - 1].append((b - 1, i))
    edges[b - 1].append((a - 1, i))
l = [0 for i in range(n)]
def dfs(cur, x):
    res = 1
    for i in edges[cur]:
        if i[1] != x:
            res += dfs(i[0], i[1])
    l[x] = res
    return res
dfs(0, -1)
l2 = [1]
i2 = pow(2, mod - 2, mod)
for i in range(n):
    l2.append(l2[-1] * i2 % mod)
cnt = 0
for i in l:
    cnt += (1 - l2[i]) * (1 - l2[n - i])
print((-n * i2 - l2[-1] + cnt + 1) % mod)
n = input()
n[4] = 8
print(n)

### FIXED CODE ###

print('2018'+input()[4:])
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))

print(sum([1 if K<=a else 0 for a in A])

### FIXED CODE ###

N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
print(sum([1 if K<=a else 0 for a in A]))
from math import factorial
N,M=list(map(int,input().split()))
dansa=[int(input()) for _ in range(M)]
ans=1
flag=True
if dansa[0]==0:
    print("0")
else:
    if len(dansa)>1:
        for i in range(M-1):
            if dansa[i]+1==dansa[i+1]:
                print("0")
                flag=False
                break
if flag:
    dansa.insert(0,0)
    dansa.append(N)
    for i in range(M+1):
        tmp=dansa[i+1]-dansa[i]-1
        arr=[i for i in range(int(tmp/2)+1)]
        #print("tmp:{}".format(tmp))
        hoge=0
        """
        if tmp%2==0:
            arr=[j*2 for j in range(0,int(tmp/2+1))]
            
        else:
            arr=[j*2+1 for j in range(0,int((tmp+1)/2))]
        """
        #print(arr)
        #if tmp%2==0:
        for k in arr:
            n=tmp-k
            hoge+=factorial(n) / factorial(k) / factorial(n-k)
            
        print(hoge)
        ans=ans*hoge
        print(ans)
    #print(int(ans%1000000007))
    print(ans)



### FIXED CODE ###




mod=10**9+7
n,m=list(map(int,input().split()))
a=[int(input()) for _ in range(m)]
fib=[1,1]
c=0
if m>0 and a[0]==1:
    fib[1]=0
    c+=1
for i in range(2,n+1):
    if c<m and a[c]==i:
        fib.append(0)
        c+=1
    else:
        fib.append((fib[i-2]+fib[i-1])%mod)

print(fib[n])
n,*a=map(int,open(0).read().split())
b,m=sum(a),n*-~n//2
n-=1
c=b//m
f=b%m>0
for i,j in zip(*[iter([a[-1]]+a*2)]*2):
  j-=i
  t=min(0,j//n)
  f|=c!=j+n*-t-t
print('YNEOS'[f::2])

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
b,m=sum(a),n*-~n//2
n-=1
c=b//m
f=b%m>0
for i,j in zip(*[iter([a[-1]]+a*2)]*2):
  j-=i
  if n:
    t=min(0,j//n)
    f|=c!=j+n*-t-t
print('YNEOS'[f::2])
def lcm(a,b):
    c=4
    return a/c*b



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))


### FIXED CODE ###

'''
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c

    c=a%b

    if c==0:
     return b
    else:
     return gcd(b,c)
'''

def gcd(a,b):
    return a if b == 0 else gcd(b,a%b)

def lcm(e,f):
    c=gcd(e,f)
    g=e*f
    return g//c



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))
from functools import cmp_to_key

MOD = 10 ** 9 + 7


def func(a, b):
    if a[0] * b[1] == a[1] * b[0]:
        return 0
    elif a[0] * b[1] < a[1] * b[0]:
        return - 1
    else:
        return 1


n = int(input())
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())
    if a[i] < 0:
        a[i] = -a[i]
        b[i] = -b[i]
    if a[i] == 0 and b[i] < 0:
        b[i] = -b[i]
l = sorted(zip(a, b), key=cmp_to_key(func))
if l[0][1] > 0:
    li = [[1, 0, l[0][0], l[0][1]]]
else:
    li = []
i = -1
for i in range(1, n):
    a, b = l[i - 1]
    c, d = l[i]
    if d <= 0:
        break
    if a * d == b * c:
        li[-1][0] += 1
    else:
        li.append([1, 0, c, d])
idx = 0
cnt = 0
for j in range(n):
    a, b = l[j]
    if b > 0:
        continue
    a, b = -b, a
    while idx < len(li) and li[idx][2] * b < li[idx][3] * a:
        idx += 1
    if idx < len(li) and li[idx][2] * b == li[idx][3] * a:
        li[idx][1] += 1
    else:
        cnt += 1
ans = 1
for a, b, c, d in li:
    ans *= (pow(2, a, MOD) + pow(2, b, MOD) - 1)
    ans %= MOD
print(((ans) * (pow(2, cnt, MOD)) - 1) % MOD)


### FIXED CODE ###

from functools import cmp_to_key

MOD = 10 ** 9 + 7


def func(a, b):
    if a[0] * b[1] == a[1] * b[0]:
        return 0
    elif a[0] * b[1] < a[1] * b[0]:
        return - 1
    else:
        return 1


n = int(input())
a = [0] * n
b = [0] * n
i = 0
f = 0
while i < n:
    a[i], b[i] = map(int, input().split())
    if a[i] == 0 and b[i] == 0:
        f += 1
        n -= 1
        continue
    if a[i] < 0:
        a[i] = -a[i]
        b[i] = -b[i]
    if a[i] == 0 and b[i] < 0:
        b[i] = -b[i]
    i += 1
l = sorted(zip(a, b), key=cmp_to_key(func))
if l[0][1] > 0:
    li = [[1, 0, l[0][0], l[0][1]]]
else:
    li = []
for i in range(1, n):
    a, b = l[i - 1]
    c, d = l[i]
    if d <= 0:
        break
    if li and a * d == b * c:
        li[-1][0] += 1
    else:
        li.append([1, 0, c, d])
idx = 0
cnt = 0
for j in range(n):
    a, b = l[j]
    if b > 0:
        continue
    a, b = -b, a
    while idx < len(li) and li[idx][2] * b < li[idx][3] * a:
        idx += 1
    if idx < len(li) and li[idx][2] * b == li[idx][3] * a:
        li[idx][1] += 1
    else:
        cnt += 1
ans = 1
for a, b, c, d in li:
    ans *= (pow(2, a, MOD) + pow(2, b, MOD) - 1)
    ans %= MOD
print((ans * (pow(2, cnt, MOD)) - 1 + f) % MOD)
def f(n):
    return sum(map(int,str(n)))

X = int8(input())

if X % f(X) == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

def f(n):
  return sum(map(int, str(n)))

X = int(input())

if X % f(X) == 0: 
  print("Yes")
else:
  print("No")
import math
N=int(input())
h = [int(i) for i in input().split()]
h = h[::-1] +[1,-1]
#print(h)
i=0
count=0
while True:
    if h[i+1]*h[i+2]<1:
        break
    a=abs(h[i+1]-h[i])
    b=abs(h[i+2]-h[i])
    if a<b:
        i+=1
        count+=a
    else:
        i+=2
        count+=b
print(count)

### FIXED CODE ###

INF =10001
N = int(input())
h = [int(i) for i in input().split()]
i = 2
dp = [INF for i in range(N)]
dp[0],dp[1] = 0,abs(h[1]-h[0])

while not i==N:
    dp[i] = min(dp[i-2]+abs(h[i] - h[i-2]),dp[i-1]+abs(h[i] - h[i-1]))
    i+=1
    
print(dp[N-1])
# https://atcoder.jp/contests/aising2019/submissions/3986315
# 解説のように 連結成分を求めてから、bfsする

H, W = map(int, input().split())
s = [input() for _ in range(H)]

ans = 0

dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]

un_reached = [[True for i in range(W)] for j in range(H)]


def isIn(x, y):
    return 0 <= x < H and 0 <= y < W


def dfs(x, y):
    un_reached[x][y] = False
    if s[x][y] == '#':
        cc[1] += 1
    else:
        cc[0] += 1

    for i in range(4):
        nx = x+dx[i]
        ny = y+dy[i]
        if isIn(nx, ny) and s[nx][ny] != s[x][y] and un_reached[nx][ny]:
            dfs(nx, ny)


for i in range(H):
    for j in range(W):
        if un_reached[i][j]:
            cc = [0 for _ in range(2)]
            dfs(i, j)
            ans += cc[1]*cc[0]
print(ans)


### FIXED CODE ###

# https://atcoder.jp/contests/aising2019/submissions/3986315
# 解説のように 連結成分を求めてから、bfsする
import sys
sys.setrecursionlimit(2 * 10 ** 5)

H, W = map(int, input().split())
s = [input() for _ in range(H)]

ans = 0

dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]

un_reached = [[True for i in range(W)] for j in range(H)]


def isIn(x, y):
    return 0 <= x < H and 0 <= y < W


def dfs(x, y):
    un_reached[x][y] = False
    if s[x][y] == '#':
        cc[1] += 1
    else:
        cc[0] += 1

    for i in range(4):
        nx = x+dx[i]
        ny = y+dy[i]
        if isIn(nx, ny) and s[nx][ny] != s[x][y] and un_reached[nx][ny]:
            dfs(nx, ny)


for i in range(H):
    for j in range(W):
        if un_reached[i][j]:
            cc = [0 for _ in range(2)]
            dfs(i, j)
            ans += cc[1]*cc[0]
print(ans)
x=0
n=int(input())
F=list(input())
#lis=F.split()
alist=[]
alist.append(x)
for token in F:



    if token=="I":
        x=x+1
        alist.append(x)
    else:
        x=x-1
        alist.append(x)


for i in alist:

    if alist[i]>alist[i+1]:
        x=alist[i]

    else:
        x=alist[i+1]



print(x)

### FIXED CODE ###

n=int(input())
s=input()
x=0
max=0
for i in range(0,n):
    if(s[i] is 'I'):
        x+=1
    elif(s[i] is 'D'):
        x-=1
    if max<x:
        max=x
print(max)
import sys

while 1:
    x = raw_input()
    if x == 0: break
    poyo = 0
    for i in xrange(len(x)):
        poyo += int(x[i])
    print poyo

### FIXED CODE ###

import sys

while 1:
    x = raw_input()
    if x == '0': break
    poyo = 0
    for i in xrange(len(x)):
        poyo += int(x[i])
    print poyo
import numpy as np

n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

dp = [0] * n
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, n):
    ik = max(0, i-k)
    dp[i] = np.min(dp[ik:i]+np.abs(h[i]-h[ik:i]))

print(int(dp[n-1]))


### FIXED CODE ###

import numpy as np

n, k = map(int, input().split())
h = np.array([int(i) for i in input().split()])

dp = np.zeros(n)
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, n):
    ik = max(0, i-k)
    dp[i] = np.min(dp[ik:i]+np.abs(h[i]-h[ik:i]))

print(int(dp[n-1]))
# C When I hit my pocket
k,a,b = map(int,input().split())

bis = 1

#print(k - (a + 1))
if k <= 1 or b <= a + 2 or k - (a + 1) < 0:
    print(1 + k)
    #print('true')
    exit()
else:
    bis = b
    k = k - ( a + 1)
    if not k == 0:
        bis += int(k / 2) * (b - a) + k % 2

print(bis)

### FIXED CODE ###

# A Anti-Adjacency
n,k = map(int,input().split())
if int((n +1) / 2) >= k:
    print('YES')
else:
    print('NO')
n = input()
a = input()
a = a.split(sep=' ')

result = 0
for i in range(1,int(n)+1):
    if a[a[i]] == i:
        result = result+1
result = int(result/2)
print(result)

### FIXED CODE ###

n = input()
a = input()
a = a.split(sep=' ')

result = 0
for i in range(1,int(n)+1):
    if int(a[int(a[i-1])-1]) == i:
        result = result+1
result = int(result/2)
print(result)
import numpy as np
a=input()
b=input()
c=str(a)+str(b)
s=int(c)
m=np.sqrt(s)
if m*m==s:
  print("Yes")
else:
  print("No")
  
  

### FIXED CODE ###

import math
a,b=input().split()

ss=str(a)+str(b)
num=int(ss)
n=math.sqrt(num)

if (int(n)*int(n)==num):
  print("Yes")
else:
  print("No")
x=int(input())
l=[]
for i in range(1,int(x**0.5)+1):
  if x%i==0:
    l.append(i)
    l.append(x//i)
for i in l:
  for j in range(x**0.2+10*2,0,-1):
    A=j
    B=j-i
    if A<B:
      break
    if A**5-B**5==x:
      print(A,B,sep=' ')
      exit()

### FIXED CODE ###

x=int(input())
l=[]
for i in range(1,int(x**0.5)+1):
  if x%i==0:
    l.append(i)
    l.append(x//i)
for i in l:
  for j in range(int(x**0.2)+100,0,-1):
    A=j
    B=j-i
    if A<B:
      break
    if A**5-B**5==x:
      print(A,B,sep=' ')
      exit()
def aaa(seat_list):
	return seat_list[len(seat_list)-1] - seat_list[0]

value = int(input())

people = 0
# while True:
# 	try:
# 		seat = input()
# 		seat_list.append(int(seat.split(" "))
# 	except EOFError:
# 		break
while True:
	seat = input()
	if seat:
		string_seat = seat.split()
		seat_list = []
		seat_list = [int(x) for x in (string_seat)]
		people += aaa(seat_list)
	else:
		break

print(people)


### FIXED CODE ###

value = int(input())
people = 0
while True:
	try:
		seat = input()
		if seat:
			string_seat = seat.split()
			seat_list = []
			seat_list = [int(x) for x in (string_seat)]
			people += seat_list[len(seat_list)-1] - seat_list[0]+1
	except EOFError:
		break
# while True:
# 	seat = input()
# 	if seat:
# 		string_seat = seat.split()
# 		seat_list = []
# 		seat_list = [int(x) for x in (string_seat)]
# 		people += aaa(seat_list)
# 	else:
# 		break
print(people)
s = input()
w = int(input())
ans = []
asn.append(s[0])
for i in range(1,w//3+1):
  ans.append(s[w*i+1])
print(ans)
  

### FIXED CODE ###

s=input()
n = int(input())
print(s[::n])
def main():
    n, m = map(int, input().split())
    a = [0] * m
    b = [0] * m
    for i in range(m):
        a[i], b[i] = map(int, input().split())


    c = [0] * n
    for i in range(m):
        c[a[i]] = 1
        c[b[i]] = 1


    count = 0
    for i in range(n):
        if c[i] == 0:
            count += 1

    print(count)





if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    k = int(input())
    print('ACL' * k)


if __name__ == '__main__':
    main()
a,b=map(int,input().split())

print((a*(b*100))//100)

### FIXED CODE ###

a, b = input().split()  # まず文字列で受け取ります
p = int(a) # aはそのままint型にします
q = int(b[0] + b[2] + b[3])  # b[0] + b[2] + b[3]を整数に変換すれば、bの100倍を正確に得られます

print(p * q // 100)  # 掛けて100で整数の割り算をすれば終わりです
import math
def is_prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True        

n=int(input())
cnt=0
e=[]# used_list
f=0
pn=[2,3,5,7,11,13,17,19,23,29,31,37,41]
z=[2,3,4,5,7,8,9,16,25,27,32]
if n==1:
  cnt=0

else:
  while not is_prime(n):
    if n%z[f]==0:
      n=n//z[f]
      cnt+=1
      if n==1:break
    f+=1

print(cnt)

### FIXED CODE ###

n=int(input())

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])
    if arr==[]:
        arr.append([n, 1])
    return arr

if n==1:
  print(0)
  exit()  
  
f=factorization(n)
cnt=0
for i in range(len(f)):
  m=2 # 強引
  while f[i][1]>0:
    f[i][1]-=m
    m+=1
    cnt+=1
#    print(f)
print(cnt)
N = int(input())
A = list(map(int, input().split()))
syoji = 1000
kabu = 0
kai = 0
for i in range(N):
  sw = 0
  if kabu == 0 and A[i] < A[i+1] and i < N-1:
    sw = 1
  elif kabu > 0 and kai < A[i]:
    syoji = syoji + kabu*A[i]
    kabu = 0 
  if sw == 1:#zengai
    for num in range (100):
      if syoji < num*A[i]:
        kabu = num-1
        syoji = syoji - (num-1)*A[i]
        kai = A[i]
        break
        
  print(syoji)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
syoji = 1000
kabu = 0
kai = 0
uri = 0
if N ==1:
  print(syoji)
  exit()
sw = 0
for i in range(N):
  if i<N-1 and kabu == 0 and A[i] < A [i+1]:
    for j in range(i+1,N):
      if sw ==1 and uri >= A[j]:
        break
 
      elif  A[i] < A[j]:
        uri = A[j]
        sw = 1
    if sw ==1:
      kabu = syoji // A[i]
      syoji = syoji - kabu*A[i]
      kai = A[i]
      sw = 0
  elif kabu > 0 and A[i]==uri:
    syoji = syoji + kabu*A[i]
    kabu = 0
    uri = 0
 
        
print(syoji)
import math
num = input().split()
a, b, c, d = int(num[0]), nt(num[1]), nt(num[2]), nt(num[3])

if math.abs(a-b)<=d and math.abs(b-c)<=d:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

num = input().split()
a, b, c, d = int(num[0]), int(num[1]), int(num[2]), int(num[3])

if abs(a-b)<=d and abs(b-c)<=d or abs(a-c) <= d:
  print("Yes")
else:
  print("No")
moji = [input() for i in range(2)]
if len(moji(0)) >= 1 and len(moji(0)) <= 10 and len(moji(0))+1 = len(moji(1)):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

moji = [input() for i in range(2)]
if len(moji[0]) >= 1 and len(moji[0]) <= 10 and len(moji[0])+1 == len(moji[1]) and moji[0] == moji[1][:len(moji[0])]:
  print("Yes")
else:
  print("No")
import networkx as nx

H, W = map(int, input().split())
S = [input() for i in range(H)]

G = nx.Graph()
for i in range(len(S)):
    for j in range(len(S[i])):
        if S[i][j] == '.':
            G.add_node((i,j))

for i in list(G.nodes):
    if G.has_node((i[0],i[1]+1)):
        G.add_edge(i, (i[0], i[1]+1))
    if G.has_node((i[0]+1,i[1])):
        G.add_edge(i, (i[0]+1, i[1]))

maxpath = 0
nodes = list(G.nodes)
for i in range(len(nodes)-1):
    for j in range(i+1, len(nodes)):
        l = len(nx.shortest_path(G, source=nodes[i], target=nodes[j]))
        maxpath = max(l, maxpath)

print(maxpath - 1)


### FIXED CODE ###

import queue

H, W = map(int, input().split())
S = [input() for i in range(H)]
q = queue.Queue()
longest_path = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            g = [[0 if S[k][l] == '.' else -1 for l in range(W)] for k in range(H)]
            q.put((i,j))
            g[i][j] = 0
            while not(q.empty()):
                x, y = q.get()
                for nx, ny in [(x+1, y),(x-1, y),(x, y+1),(x, y-1)]:
                    if nx < 0 or nx > H-1 or ny < 0 or ny > W-1: continue
                    if g[nx][ny] != 0: continue
                    if nx == i and ny == j: continue
                    g[nx][ny] = g[x][y] + 1
                    q.put((nx,ny))
            '''
            print('===========')
            for line in g:
                print(line)
            '''     
            longest_path = max(longest_path, max(map(max, g)))
print(longest_path)
n,q = map(int, input().split())
s = input()
ruiseki = [0]*(n+1)
for j in range(n):
    ruiseki[j+1] = ruiseki[j]
    if s[j] =="A" and s[j+1]=="C":
        ruiseki[j+1] += 1
for i in range(q):
    l, r = map(int, input().split())
    print(ruiseki[r-1] - ruiseki[l-1])




### FIXED CODE ###

n, q = map(int, input().split())
s = input()
ans = [0 for _ in range(n)]
for i in range(len(s) - 1):
    if s[i:i+2] == "AC":
        ans[i+1] = ans[i]+1
    else:
        ans[i+1] = ans[i]
    #1indexの累積和

for j in range(q):
    l, r = map(int, input().split())
    print(ans[r-1]-ans[l-1])
#!/usr/bin/env python
# -*- conding: utf-8 -*-

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'


### FIXED CODE ###

#!/usr/bin/env python
# -*- conding: utf-8 -*-

raw = raw_input()
a = int(raw.split()[0])
b = int(raw.split()[1])
c = int(raw.split()[2])

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'
s,t=map(int,input().split())
print(t+s)

### FIXED CODE ###

s,t=map(str,input().split())
print(t+s)
s,t=inut(),input()
print(len([1 for i in range(3) if s[i]==t[i]]))

### FIXED CODE ###

s=input()
t=input()
c=0
for i in range(3):
  if s[i]==t[i]:
    c+=1
print(c)
n,m=map(int,input().split())
denkyu_switch=[]
res=0
for i in range(m):
    denkyu_switch+=[list(map(int, input().split()))[1:]]
p=list(map(int, input().split()))
for i in range(2**n):
    denkyu = [0] * m
    for j in range(n):
        if i>>j & 1:
            for k in denkyu_switch:
                if j in k:
                    denkyu[k]+=1
    if p==denkyu:
        res+=1
print(res)


### FIXED CODE ###

n,m=map(int,input().split())
denkyu_switch=[]
res=0
for i in range(m):
    denkyu_switch+=[list(map(int, input().split()))[1:]]
p=list(map(int, input().split()))
for i in range(2**n):
    denkyu = [0] * m
    for j in range(n):
        if i>>j & 1:
            for k in range(m):
                if j+1 in denkyu_switch[k]:
                    denkyu[k]+=1
    denkyu2=[i%2 for i in denkyu]
    if p==denkyu2:
        res+=1
print(res)
[n], *e = [[*map(int, t.split())] for t in open(0)]
ans = 0
mod = 10 ** 9 + 7
slope_dict = {}
for x, y in e:
    a = 2**slope_dict.get(x/y, 0)
    b = 2**slope_dict.get(-y/x, 0)
    ans = ((ans * (2 * a + b - 1) + a)/(a + b - 1))  # % mod
    slope_dict[x/y] = slope_dict.get(x/y, 0) + 1

print(int(ans % mod))


### FIXED CODE ###

from math import gcd
from collections import defaultdict
mod = 10**9+7
_, *S = open(0)
mp = defaultdict(lambda: [0, 0])
O = 0
for s in S:
    a, b = map(int, s.split())
    if a == b == 0:
        O += 1
    else:
        g = gcd(a, b)
        a //= g
        b //= g
        if a < 0 or a == 0 < b:
            a, b = -a, -b
        f = 0
        if b < 0:
            a, b, f = -b, a, 1
        mp[(a, b)][f] += 1
ans = 1
for k in mp:
    x, y = mp[k]
    ans = ans*(pow(2, x, mod)+pow(2, y, mod)-1) % mod
print((ans+O-1) % mod)