Harryxun/stf_run huggingface dataset:
N , K = map(int,input().split())

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

reach = [-1 for i in range(N)]
reach[0] = 0 #最初の町は0回でいく
now = 0
#loop = 1
dic ={}
dic[0] = 0
for i in range(N):
  to = A[now]-1
  if reach[to] != -1:
    ini = i+1
    #print(i,to,reach[to])
    loop = i+1 - reach[to]
    break
  if i+1 not in dic:
    dic[i+1] = to
  reach[to] = i+1
  #loop += 1
  now = to


#print(dic,reach,loop,ini)
if K <= ini:
  print(dic[K]+1)
else:
  t = (ini-loop) + (K-ini)%loop
  print(dic[t]+1)

### FIXED CODE ###

N , K = map(int,input().split())
 
A = list(map(int,input().split()))
 
reach = [-1 for i in range(N)]
reach[0] = 0 #最初の町は0回でいく
now = 0
#loop = 1
dic ={}
dic[0] = 0
for i in range(N):
  to = A[now]-1
  if reach[to] != -1:
    ini = i+1
    #print(i,to,reach[to])
    loop = i+1 - reach[to]
    break
  if i+1 not in dic:
    dic[i+1] = to
  reach[to] = i+1
  #loop += 1
  now = to
 
 
#print(dic,reach,loop,ini)
if K < ini:
  print(dic[K]+1)
else:
  t = (ini-loop) + (K-ini)%loop
  print(dic[t]+1)
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ov = []
un = 0
cnt = 0
for i in range(n):
  c = a[i]-b[i]
  if c >= 0:
    ov.append(c)
  else:
    un += c
    cnt += 1
if un == 0:
  print(0)
else:
  un *= -1
  ov.sort(reverse=True)
  ov2 = 0
  for i in range(n):
    ov2 += ov[i]
    if ov2 >= un:
      print(cnt+i+1)
      break
  else:
    print(-1)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ov = []
un = 0
cnt = 0
for i in range(n):
  c = a[i]-b[i]
  if c >= 0:
    ov.append(c)
  else:
    un += c
    cnt += 1
if un == 0:
  print(0)
else:
  un *= -1
  ov.sort(reverse=True)
  ov2 = 0
  for i in range(len(ov)):
    ov2 += ov[i]
    if ov2 >= un:
      print(cnt+i+1)
      break
  else:
    print(-1)
s=input()
s=list(s)
if s[0]=="?" and s[1]=="D":
    s[0]="P"
elif s[0]=="?" and (s[1]=="P" or s[1]=="?"):
    s[0]="D"
for i in range(1,len(s)-1):
    if s[i]=='?':
        # print(s)
        if s[i-1]=="D" and (s[i+1]=="D" or s[i+1]=="?"):
           s[i]="P"
        else:
            s[i]="D"
    # print(s)
if s[-1]=="?":
    s[-1]="D"
s1="".join(s)
print(s1)

### FIXED CODE ###

s=input()
s2=list(s)
s1=""
if s2[-1]=="?":
    s2[-1]="D"
if s2[0]=="?" and s2[1]=="D":
    s2[0]="P"
elif s2[0]=="?" and (s2[1]=="P" or s2[1]=="?"):
    s2[0]="D"
for i in range(1,len(s2)-1):
    if s2[i]=='?':
        if s2[i-1]=="D" and (s2[i+1]=="D" or s2[i+1]=="?"):
           s2[i]="P"
        else:
            s2[i]="D"
for i in s2:
    s1+=i
print(s1)
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    def checkABC(x):
        if s[x]=='A' and s[x+1]=='B' and s[x+2]=='C':
            s[x],s[x+1],s[x+2]='B','C','A'
            return True
        else:
            return False
    
    s=list(input())
    N=len(s)
    i=0
    ans=0
    while True:
        if i >= N-2:
            break
        if checkABC(i) == True:
            if i!=0 and s[i-1]=='A':
                i-=2
            else:
                i+=1
            ans+=1
        while True:
            i+=1
            if s[i] == 'A':
                break
    print(ans)
        
        

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    s=input()
    s2=list(s.replace('BC','D'))
    N=len(s2)
    ans=0
    c=0
    for i in range(N):
        if s2[i]=='A':
            c+=1
        elif c!=0 and s2[i]=='D':
            ans+=c
        else:
            c=0
    print(ans)

if __name__ == '__main__':
    main()
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
X = min(A, B, C, D, E)
if X >= N:
  print(5)
else:
  if N%X == 0:
    print(4+N//X)
  elese:
    print(5+N//X)

### FIXED CODE ###

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
X = min(A, B, C, D, E)
if X >= N:
  print(5)
else:
  if N%X == 0:
    print(4+N//X)
  else:
    print(5+N//X)
import sys
sys.setrecursionlimit(10**6) 
N = int(input())
data = list(map(int,input().split()))
res = 0
while (True):
    exist_odd: bool = False
    for i in range(N):
        if data[i]%2 == 1:
            exist_odd = True
    if exist_odd == True:
        break
        
    for i in range(N):
        data[i] = data[i]//2
    
    res += 1
        
print(res)

### FIXED CODE ###

N = 1
data = []
for i in range(N):
    data_input = list(map(int,input().split()))
    data.append(data_input)
data = data[0][0]
ans=0
for i in range(3):
    k=2-i
    ans += data // (10**k)
    data = data % (10**k)
    
print(ans)
n,m = map(int, input().split())
a = []
for i in range(n)
a[i] = list(map(int, input().split()))[i]
sort(a)
if a[m-1] > 1/4*m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n,m = map(int, input().split())

i = list(map(int, input().split()))
a=[]
for x in range(n):
    a.append(i[x])
a.sort(reverse = True)
if a[m-1] >= sum(a)/(4*m):
    print("Yes")
else:
    print("No")
n=int(input())
a=list(int(input()) for i in range(n))
for y in range(n):
  if a[y]==max(a):
  	a.remove(a[y])
  	print(max(a))
  else:
  	print(max(a))

### FIXED CODE ###

##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])
c = [list(input()) for i in range(3)]
s = ""
for j in range(3):
  s += str(c[i][i])
print(s)

### FIXED CODE ###

c = [list(input()) for i in range(3)]
s = ""
for j in range(3):
  s += str(c[j][j])
print(s)
count = 0

while True :
 x = int(input())
 count += 1
  if x == 0 :
  break
 print("Case { }: { }".format(count, x))

### FIXED CODE ###

i = 0

while True:
 n = int(input())
 i += 1
 if n == 0:
  break
 print("Case {}: {}".format(i, n))
a = int(input())
s = input()

if a>=3200:
  print(s)
 else :
   print("red")


### FIXED CODE ###

a = int(input())
s = input()

if a>=3200:
	print(s)
else :
	print("red")
a,b = int(input().split())
print(a*b," ",2*(a+b))

### FIXED CODE ###

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

men = a*b
hen = 2*(a+b)

print(men,hen,sep=" ")
print "%d" & "x*x*x"

### FIXED CODE ###

x = input()
ans = x**3
print ans
vn,m=map(int,input().split())

if n==1:
  print(m)
else:
  a=int(m**0.5)

  for i in range(a+1,0,-1):
    if m%i==0 and i*n<=m:
      print(i)
      break

### FIXED CODE ###

n,m=map(int,input().split())

ans=0

if n==1:
  print(m)
else:
  a=int(m**0.5)

  for i in range(1,a):
    if m%i==0:
      if i*n<=m:
        ans=max(ans,i)
      if (m//i)*n<=m:
        ans=max(ans,m//i)
  print(ans)
N = input();
if N%2==0:
  print(N/2)
else:
  print(N/2 + 1)

### FIXED CODE ###

N = input()
intN=int(N)
if intN%2 == 0:
    print(intN//2)
else:
    print(intN//2 +1)
f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")

N, D = map(int, f.readline().split())

dis2 = D**2

count = 0
for i in range(N):
    x, y = map(int, f.readline().split())
    if x**2 + y**2 <= dis2:
        count+=1
print(count)

### FIXED CODE ###

N, D = map(int, input().split())

dis2 = D**2

count = 0
for i in range(N):
    x, y = map(int, input().split())
    if x**2 + y**2 <= dis2:
        count+=1
print(count)
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
elif S == 'SAT':
    print('1')
else:
    print('Error'

### FIXED CODE ###

S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
elif S == 'SAT':
    print('1')
else:
    print('Error')
print(360 // int(input))

### FIXED CODE ###

X = int(input())
 
ans = 0
while(1):
  ans += 1
  if (X * ans) % 360 == 0:
    print(ans)
    break
#各丸太を何回切るか、どこで切るか
#丸太iをKi回切る場合、その丸太の最小はL//Kiとなる
#あとは、どの丸太を何回切るかを求めればよい。
"""
長い丸太ほど多く切るべき
丸太が2本、1本が10**9でもう一本が1。10**9回切れるのであれば1本目に全振りするのがベスト。

結論、元の長さの比に基づいて割り当てればよい。
一番短い丸太の長さを1として各丸太の
"""
from math import ceil
import heapq
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
pivot = A[0]
hiritu = [a/pivot for a in A]
hirituSum = sum(hiritu)
kaisu = []
for i in range(N):
    h = hiritu[i]
    k = int(K*h/hirituSum)
    kaisu.append(k)
    K -= k
if K >= 1000000:
    for i in range(N):
    h = hiritu[i]
    k = int(ceil(K*h/hirituSum))
    kaisu.append(k)
    K -= k

leng = []
for i in range(N):
    a = A[i]
    k = kaisu[i]
    leng.append(((-a/(k+1)),k,a))
heapq.heapify(leng)
for _ in range(K):
    l,k,a = heapq.heappop(leng)
    l = -a/(k+2)
    heapq.heappush(leng,(l,k+1,a))
l,k,a = heapq.heappop(leng)
l *= -1
print(ceil(l))

### FIXED CODE ###

from math import ceil
N,K = map(int,input().split())
A = list(map(int,input().split()))

def is_ok(X):
    #最大値をX以下にできるか
    cnt = 0
    for a in A:
        cnt += ceil(a/X)-1
    return cnt <= K

def bisearch(high,low):
    while high - low > 1:
        mid = (high+low)//2
        if is_ok(mid):
            high = mid
        else:
            low = mid
    return high

print(bisearch(10**9+1,0))
n = int(input())
A = list(map(int,input().split()))
aj = max(A)
temp = 100000
for a in A:
    if a != aj:
        if temp > abs(int(aj/2+0.5)-a):
            ai = a
            temp = abs(int(aj/2+0.5)-a)
            
print(aj,ai)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
aj = max(A)
temp = 10000000000
for a in A:
    if a != aj:
        if temp > abs(int(aj/2+0.5)-a):
            ai = a
            temp = abs(int(aj/2+0.5)-a)
            
print(aj,ai)
# ABC130B

n, x = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
    s += l[i]
    if s > x:
        return i+1
return n+1


### FIXED CODE ###

# ABC130B

n, x = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
    s += l[i]
    if s > x:
        print(i+1)
        break
else:
    print(n+1)
T = str(input())

for i in range(T.count("?")):
    index = T.index("?")
    if T[index - 1] == "P":
        T = T.replace("?","D",1)
    elif T[index + 1] == "D":
        T = T.replace("?","P",1)
    elif T[index + 1] == "?":
        T = T.replace("?","P",1)
    else:
        T = T.replace("?","D",1)
print(T)

### FIXED CODE ###

# B
T = str(input())
try:
    for i in range(T.count("?")):
        index = T.index("?")
        if T[index - 1] == "P":
            T = T.replace("?","D",1)
        elif T[index + 1] == "D":
            T = T.replace("?","P",1)
        elif T[index + 1] == "?":
            T = T.replace("?","P",1)
        else:
            T = T.replace("?","D",1)
    print(T)
except:
    print(T.replace("?","D"))
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n+1):
    b = 0
    for m in range(d):
      b += (int(x[i][m])-int(x[j][m]))**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

### FIXED CODE ###

n,a,b = map(int,input().split())
print(min(a*n,b))
data_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
if k == 32:
    raise Exception
print(data_list[k + 1])


### FIXED CODE ###

data_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(data_list[k - 1])
N = int( input())
A = list( map( int, input().split()))
ans = 10**15
for i in [1, -1]:
    ansi, sums = 0, 0
    for a in A:
        sums += a
        if sums*i <= 0:
            ansi += abs(sums-s)
            sums = s
        s *= -1
    ans = min( ans, ansi)
print(ans)

### FIXED CODE ###

N = int( input())
A = list( map( int, input().split()))
ans = 10**15
for i in [1, -1]:
    ansi, sums = 0, 0
    for a in A:
        sums += a
        if sums*i <= 0:
            ansi += abs(sums-i)
            sums = i
        i *= -1
    ans = min( ans, ansi)
print(ans)
N,T=map(int,input().split())
cost=1000
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if cost>=c:
            cost=c
if cost<=1000:
    print(cost)
else:print("TLE")

### FIXED CODE ###

n=int(input())
if n==1:
  print("Hello World")
else:
  a,b=[int(input()) for i in range(2)]
  print(a+b)
from math import sqrt
def isprime(inlst, i, sq):
	inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst))
	if sq >= i:
		return isprime(inlst, i +2, sq)
	else:
		return inlst

n = int(input())
inlst = []
twonum = 0
for i in range(n):
	inlst.append(int(input()))
	
inlst = list(filter(lambda x: x % 2 is not 0 or x is 2, inlst))
i = 3
maxin = max(inlst)
if len(inlst) > 0:
	inlst = isprime(inlst, i, int(sqrt(maxin)) + 1)
print(len(inlst))

### FIXED CODE ###

from math import sqrt
def isprime(inlst, chk, sq):
	for i in range(3, sq, 2):
		inlst = [x for x in inlst if x%i > 0 or x == i]
		i += 2
	return inlst
n = int(input())
inlst = [input() for i in range(n)]
inlst = [int(i) for i in inlst]
inlst = [x for x in inlst if x%2 > 0 or x == 2]
inlst = isprime(inlst, 3, int(sqrt(max(inlst))) + 1)
print(len(inlst))
N = int(input())
xyz = []
r = 0

for _ in range(N):
    temp = list(map(int, input().split()))
    xyz.append(temp)

for n in range(N):
    if xyz[n][2] == 10**9:
        ans = [str(xyz[n][0]), str(xyz[n][1]), str(xyz[n][2])]
        r = 1

if r == 1:
    pass
else:
    for i in range(101):
        for j in range(101):
            h = xyz[0][2] + abs(xyz[0][0] - i) + abs(xyz[0][1] - j)

            count = N
            for n in range(0,N):
                g = h - abs(i - xyz[n][0]) - abs(j - xyz[n][1])
                if g == xyz[n][2]:
                    count -= 1
            
            if count == 0:
                ans = [str(i), str(j), str(h)]
                break

ans_s = ' '.join(ans)
print(ans_s)

### FIXED CODE ###

N = int(input())
xyz = []

for _ in range(N):
    temp = list(map(int, input().split()))
    xyz.append(temp)


if N == 1:
    ans = [str(xyz[0][0]), str(xyz[0][1]), str(xyz[0][2])]
else:
    for i in range(101):
        for j in range(101):
            for k in range(N):
                if xyz[k][2] >= 1:      
                    h = max(xyz[k][2] + abs(xyz[k][0] - i) + abs(xyz[k][1] - j),0)

                    count = N
                    for n in range(0,N):
                        g = max(h - abs(i - xyz[n][0]) - abs(j - xyz[n][1]),0)
                        if g == xyz[n][2]:
                            count -= 1
                    
                    if count == 0:
                        ans = [str(i), str(j), str(h)]
                        break
                    break

ans_s = ' '.join(ans)
print(ans_s)
A,B=map(int,input().split())
S,T=map(str,input().split())
U=input()
if S==U:
  print(A-1,B)
else:
  print(A,B-1)

### FIXED CODE ###

S, T=map(str, input().split())
A, B=map(int, input().split())
U=input()
if S == U:
  print(A-1, B)
else:
  print(A, B-1)
n,m,k=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
a=0
b=0
cnt=0
for i in range(max(n+1,m+1)):
	if min(A[a],B[b])>k:
		break
	if A[a]>=B[b]:
		k-=B[b]
		b+=1
		cnt+=1
	else:
		k-=A[a]
		a+=1
		cnt+=1
print(cnt)

### FIXED CODE ###

n,m,k=map(int, input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
import bisect
AR=[0]
BR=[0]
for i in range(n):
	AR.append(A[i]+AR[i])
for i in range(m):
	BR.append(B[i]+BR[i])

ans=0
for i in range(n+1):
	if AR[i]>k:
		break
	s=k-AR[i]
	t=bisect.bisect(BR,s)-1
	ans=max(ans,i+t)
print(ans)
import copy
h,w=map(int,input().split())
a=[list(map(lambda x:0 if x=="#" else 1,input())) for i in range(h)]
b=[[0 for i in range(w)] for j in range(h)]
count=0
while a!=b:
  z=copy.deepcopy(a)
  for i in range(h):
    for j in range(w):
      a[i][j]=(z[i-1][j] if i!=0 else 1)*(z[i+1][j] if i!=h-1 else 1)*(z[i][j-1] if j!=0 else 1)*(z[i][j+1] if j!=h-1 else 1)
  count+=1
print(count)


### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
a=[input() for _ in range(h)]
visited=[[-1]*w for _ in range(h)]
queue=deque()
for i in range(h):
  for j in range(w):
    if a[i][j]=='#':
      visited[i][j]=0
      queue.append([i,j])
while queue:
  y,x=queue.popleft()
  for j,k in ([1,0],[-1,0],[0,1],[0,-1]):
    n_y,n_x=y+j,x+k
    if 0<=n_y<h and 0<=n_x<w and a[n_y][n_x]=='.' and visited[n_y][n_x]<0:
      visited[n_y][n_x]=visited[y][x]+1
      queue.append([n_y,n_x])
ans=0
for l in visited:
  ans=max([ans]+l)
print(ans)
a,b = list(map(int,input().split(" "))
print(a*b,a*2+b*2)

### FIXED CODE ###

a,b = list(map(int,input().split(" ")))
print(a*b,a*2+b*2)
n=int(input())
a=list(map(int,input().split()))
b=[]
for _ in range(n):
  if a[_]<0:
    b.append(a.pop(_)*(-1))
if 0 in a or len(b)%2==0:
  print(sum(a)+sum(b))
else:
  b.sort()
  print(sum(a)+sum(b[1:])-b[0])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
  if a[i]<0:
    c+=1
    a[i]=a[i]*-1
if c%2==0 or 0 in a:
  print(sum(a))
else:
  a.sort()
  print(sum(a[1:])-a[0])
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 28 21:42:33 2016

@author: you
"""

n = int(input())
a = list(map(int, input().split()))
a.sort()
colornum = 0
colorflag = [0,0,0,0,0,0,0,0]
rainbow = 0
maxvalue = 0
minvalue = 0
for i in range(n):
    if colorflag[0] == 0 and a[i] < 400:
        colornum = colornum + 1
        colorflag[0] = 1
    elif colorflag[1] == 0 and a[i] >= 400 and a[i] < 800:
        colornum = colornum + 1
        colorflag[1] = 1
    elif colorflag[2] == 0 and a[i] >= 800 and a[i] < 1200:
        colornum = colornum + 1
        colorflag[2] = 1
    elif colorflag[3] == 0 and a[i] >= 1200 and a[i] < 1600:
        colornum = colornum + 1
        colorflag[3] = 1
    elif colorflag[4] == 0 and a[i] >= 1600 and a[i] < 2000:
        colornum = colornum + 1
        colorflag[4] = 1
    elif colorflag[5] == 0 and a[i] >= 2000 and a[i] < 2400:
        colornum = colornum + 1
        colorflag[5] = 1
    elif colorflag[6] == 0 and a[i] >= 2400 and a[i] < 2800:
        colornum = colornum + 1
        colorflag[6] = 1
    elif colorflag[7] == 0 and a[i] >= 2800 and a[i] < 3200:
        colornum = colornum + 1
        colorflag[7] = 1
    elif a[i] >= 3200:
        rainbow = rainbow + 1
for j in range(8):
    if colorflag[j] == 1:
        minvalue = minvalue + 1
maxvalue = minvalue + rainbow
if minvalue == 0:
    minvalue = 1
    maxvalue = rainbow
print(minvalue,maxvalue)


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Aug 28 21:42:33 2016

@author: you
"""

n = list(map(int, input().split()))
l = n[0] * 100 + n[1] * 10 + n[2]
m = l % 4
if m == 0:
    ans = "YES"
else:
    ans = "NO"
print(ans)
X= int(input())
ans = X // 500 * 1000
X -= X // 500 * 
ans += (X // 5) * 5
print(ans)

### FIXED CODE ###

X = int(input())

ans = 0

num = X // 500
X -= 500 * num
ans += num * 1000

num = X // 5
ans += num * 5

print(ans)
word = input()
if word[-1] == 's':
  return ''.join(word, 'es')
else:
  return ''.join(word, 's')

### FIXED CODE ###

word = input()
if word[-1] == 's':
  print(word+'es')
else:
  print(word+'s')
n = int(input())
if n < 105:
  print(0)
else:
  ans = 0
  for i in range(n,103,-2):
    count = 1
    for j in range(1,99,2):
      nj = n%j
      if nj == 0:
        count += 1
      if count == 9:
        ans -= 1
    if count == 8:
      ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = 0
for i in range(1,n+1,2):
  c = 0
  for j in range(1,n+1):
    if i%j == 0:
      c += 1
  if c == 8:
    a +=1
print(a)
a = int(input())
b = int(input())
c = int(input())
d = int(input())

# aとcの絶対値がｄ以下
if abs(c - a) <= d:
    print("Yes")

elif abs(b-a) <= d and abs(c - b)<= d:
    print("Yes")

else:
    print("No")

### FIXED CODE ###

a,b,c,d = map(int , input().split())

# aとcの絶対値がｄ以下
if abs(c - a) <= d:
    print("Yes")

elif abs(b-a) <= d and abs(c - b)<= d:
    print("Yes")

else:
    print("No")
#import numpy as np
import time

N = int(input())
A = list(map(int, input().split()))
A.sort()#わるほう
remove_list = []

kouho = sorted([x for x in set(A) if A.count(x) == 1])
#maxA = 10**5

#target = kouho[:]
if kouho != []:
    maxA = kouho[-1]
    work=[0]*(maxA+1)

for i in range(len(A)):
    if kouho == []:
        break
    maxN = int(maxA/A[i])
    for n in range(1,maxN+1):
        buf = A[i]*n
        #remove_list.append(buf)
        work[buf]+=1
            #print(A[i]*n)

#target = kouho[:]
#kouho = list(set(kouho) - set(remove_list))

sm=0
for s in A:
    if work[s]==1: sm+=1
print(sm)

#print(len(kouho))

### FIXED CODE ###

#import numpy as np

N = int(input())
A = list(map(int, input().split()))
A.sort()#わるほう

#kouho = sorted([x for x in set(A) if A.count(x) == 1])
#maxA = 10**5

#target = kouho[:]
maxA = A[-1]
work=[0]*(A[-1]+1)

for i in range(len(A)):
    if work[A[i]]<=1:
        maxN = int(maxA/A[i])
        for n in range(1,maxN+1):
            buf = A[i]*n
            #remove_list.append(buf)
            work[buf]+=1
                #print(A[i]*n)

#target = kouho[:]
#kouho = list(set(kouho) - set(remove_list))

sm=0
for s in A:
    if work[s]==1: sm+=1
print(sm)

#print(len(kouho))
import math
import sys
input = sys.stdin.readline

A,B = (int(x) for x in input().split())


print(A*B//math.gcd(A,B))

### FIXED CODE ###

import fractions
import sys
input = sys.stdin.readline

A,B = (int(x) for x in input().split())


print(A*B//fractions.gcd(A,B))
# coding: utf-8
# Your code here!
n = int(input())
s = list(map(int,input().split()))
ans = {}
#各番号がいくつずつあるのかを整理
#keyに番号、valueにその番号が書かれてあるボールの数
for i in range(n):
    if not s[i] in ans.keys():
        ans[s[i]] = 1
    else:
        ans[s[i]] += 1
#iC2の総和
answer = 0
for i in ans.values():
    answer += i*(i-1)//2
#answer-nC2+(n-1)C2 = answer-n+1
#nはans[s[i]],よって以下の出力で求められる
for i in range(n):
    print(answer-ans[s[i]]+1)


### FIXED CODE ###

n = list(map(int,input().split()))
ans = 0
if n[0]>=2:
    ans += n[0]*(n[0]-1)//2
if n[1]>=2:
    ans += n[1]*(n[1]-1)//2
print(ans)
a=list(map(int,input().split()))
b=1
for i in range(a[0],a[1]+1):
  b*=i
if b>0:
  print('Positive')
elif b<0:
  print('Negative')
elif b=0:
  print('Zero')

### FIXED CODE ###

a=input().split()
a[0]=int(a[0])
a[1]=int(a[1])
if(a[0]<=0 and a[1]>=0):
    print("Zero")
elif(a[0]<0 and a[1]<0 and (a[1]-a[0])%2==0):
    print("Negative")
else:
    print("Positive")
a,b=map(int, input().split())
A = list(map(int, input().split()))
sum = 0
for at in list:
	sum += at
	
	
if a <= sum:
	print("Yes")
else:
	print("No")

### FIXED CODE ###


a,b=map(int, input().split())
A = list(map(int, input().split()))
sum = 0
for at in A:
	sum += at
	
	
if a <= sum:
	print("Yes")
else:
	print("No")
N = int(input())
As = list(map(int, input().split()))
As.insert(0, 0)
Ans = [0 for _ in range(N + 1)]
Ans[N] = As[N]
for i in range(N - 1, 0, -1):
    p = i * 2
    s = 0
    while True:
        if p > N:
            break
        s += Ans[p]
        p += i
    Ans[i] = 0 if s % 2 == As[i] else 1
M = sum(Ans)
print(M)
if M > 0:
    bs = ""
    for i in range(1, N + 1):
        if Ans[i] != 0:
            bs += "%d " % i
    bs = bs.rstrip(" ")
    print(bs)


### FIXED CODE ###

r = int(input())
print(3 * r * r)