Harryxun/stf_run huggingface dataset:
X=int(input())
def PrimeFactor(n):
    ret=[]
    for i in range(2,int(-(-n**0.5//1))+1):
        if i!=2 and i%2==0:
            continue
        cnt=0
        while n%i==0:
            cnt+=1
            n//=i
        if cnt!=0:
            ret.append([i,cnt])
    if n!=1:
        ret.append([n,1])
    return ret
L=PrimeFactor(X)
L.append([1,1])
Y=False
ans=[]
for l in L:
    x=l[0]
    b=-1*x-1
    while True:
        tmp=(b+x)**5-b**5
        if tmp==X:
            Y=True
            ans=[b+x,b]
            break
        if tmp>X and b>0 and b+x>0:
            break
        b+=1
    if Y:
        break
print(ans[0],ans[1])

### FIXED CODE ###

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

    # divisors.sort()
    return divisors
L=make_divisors(X)
Y=False
ans=[]
for x in L:
    a=0
    while True:
        tmp=a**5-(a-x)**5
        if tmp==X:
            Y=True
            ans=[a,a-x]
            break
        if tmp>X and a>int(X**0.2)+1:
            break
        a+=1
        
    if Y:
        break
print(ans[0],ans[1])
r, c = map(int, input().split())
table = []
for i in range(r):
    table.append(list(map(int, input().split())))
for i in table:
    i.append(sum(i))
b = []
for i in range(c):
    b.append(sum(list(table[k for k in range(r)])))
b.append(sum(b))
for i in table:
    print(" ".join(map(str, i)))
print(" ".join(map(str, b)))


### FIXED CODE ###

r, c = map(int, input().split())
table = []
for i in range(r):
    table.append(list(map(int, input().split())))
for i in table:
    i.append(sum(i))
b = []
for i in range(c):
    x = 0
    for k in range(r):
        x += table[k][i]
    b.append(x)
b.append(sum(b))
for i in table:
    print(" ".join(map(str, i)))
print(" ".join(map(str, b)))
N = int(input())
A = list(map(int, input().split()))
B=[2]*(N)
if n<=2:
    print(1)
    exit(0)
 
for i in range(N-1):
    if A[i]>A[i+1]:
        B[i]=-1
    elif A[i]==A[i+1]:
        B[i]=0
    elif A[i]<A[i+1]:
        B[i]=1
i=0
cnt=[0]*N
while True:
    if B[i]==1:
        if B[i+1]==0 or B[i+1]==1:
            i+=1
        elif B[i+1]==-1:
            if cnt[i-1]==0 or i==0:
                cnt[i]=1
            i+=1
        else:
            i+=1
    if B[i]==0:
        i+=1
    if B[i]==-1:
        if B[i+1]==0 or B[i+1]==-1:
            i+=1
        elif B[i+1]==1:
            if cnt[i-1]==0 or i==0:
                cnt[i]=1
            i+=1
        else:
            i+=1
    if B[i]==2:
        break
print(cnt.count(1)+1)



### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
i=0
cnt=0

tmp=[]
for i in range(1,n):
    if a[i]>a[i-1]:
        tmp.append(1)
    elif a[i]==a[i-1]:
        tmp.append(0)
    else:
        tmp.append(-1)

flg=0
swi=0
for j in range(len(tmp)):
    if swi==1:
        flg=tmp[j]
        swi=0
        continue
 
    if flg==0:
        flg=tmp[j]
    elif flg==1:
        if tmp[j]==-1:
            cnt+=1
            flg=-1
            swi=1
    elif flg==-1:
        if tmp[j]==1:
            cnt+=1
            flg=1
            swi=1

print(cnt+1)
n=int(input())
sum=0
for i in range(1:n+1):
  sum+=i
print(sum)

### FIXED CODE ###

n =int(input())
sum=0
for i in range(n):
  sum+=(i+1)
print(sum)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

C = A.copy()
for i in range(N):
    if C[i] - B[i] > 0:
        C[i] -= B[i]
    else:
        C[i+1] = C[i+1] - (B[i] - C[i]) if C[i+1] - (B[i] - C[i]) > 0 else 0
        C[i] = 0
    # print(C)

beaten_monster: int = sum(A) - sum(C)
print(beaten_monster)


### FIXED CODE ###

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

C = A.copy()
for i in range(N):
    if C[i] - B[i] > 0:
        C[i] -= B[i]
    else:
        C[i+1] = C[i+1] - (B[i] - C[i]) if C[i+1] - (B[i] - C[i]) > 0 else 0
        C[i] = 0
    # print(C)

beaten_monster = sum(A) - sum(C)
print(beaten_monster)
from numba import njit

n, k = map(int, input().split())
arr = list(map(int, input().split()))


@njit
def main():
    INF = 1 << 40

    # dp初期化
    dp = [INF] * n
    dp[0] = 0

    for i in range(1, n):
        dp[i] = min(dp[j] + abs(arr[i] - arr[j])
                    for j in range(max(i - k, 0), i))

    print(dp[n - 1])

### FIXED CODE ###

n, k = map(int, input().split())
arr = list(map(int, input().split()))

# dp初期化
dp = [float("inf")] * n
dp[0] = 0

for i in range(1, n):
    dp[i] = min(dp[j] + abs(arr[i] - arr[j]) for j in range(max(i - k, 0), i))

print(dp[n - 1])
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
from numba import njit
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
A = LI()
# A = np.array(_A,dtype='int')
Q = I()
BC = [LI() for _ in range(Q)]
# print(BC)

def convert(n):
    return d[n]

d = {1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9}
for i in range(Q):
    for key, value in d.items():
        if BC[i][0] == value:
            d[key]=BC[i][1]
    ans = np.array(list(map(convert,A)),dtype='int')
    print(ans.sum())


# ans = list(map(convert,A))
# for item in ans:
#     print(item)
# print('\n'.join(str(ans)))

#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

# if ans:
#     print('Yes')
# else:
#     print('No')

### FIXED CODE ###

import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
from numba import njit
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
A = LI()
Q = I()
BC = [LI() for _ in range(Q)]

sum_A = sum(A)
c = collections.Counter(A)

for pair in BC:
    num_from = pair[0]
    num_to = pair[1]
    if num_from in c:
        diff = (num_to - num_from) * c[num_from]
        sum_A += diff
        print(sum_A)
        c[num_to] += c[num_from]
        c[num_from]=0
    else:
        print(sum_A)
import math
n = input()

def koch(n, p1_x, p2_x, p1_y, p2_y):
  if n == 0:
    return

  s_x = (2*p1_x + p2_x) / 3
  s_y = (2*p1_y + p2_y) / 3
  t_x = (p1_x + 2*p2_x) / 3
  t_y = (p1_y + 2*p2_y) / 3

  u_x = (t_x - s_x)/2 - (t_y - s_y) * sqrt(3)/2 + s_x
  u_y = (t_x - s_x) * sqrt(3)/2 + (t_y - s_y)/2 + s_y

  koch(n-1, p1_x, s_x, p1_y, s_y)
  print s_x, s_y
  koch(n-1, s_x, u_x, s_y, u_y)
  print u_x, u_y
  koch(n-1, u_x, t_x, u_y, t_y)
  print t_x, t_y
  koch(n-1, t_x, p2_x, t_y, p2_y)

p1_x = 0.0
p1_y = 0.0
p2_x = 100.0
p2_y = 0.0

print p1_x, p1_y
koch(n, 0, 100, 0, 0)
print p2_x, p2_y

### FIXED CODE ###

import math
n = int(input())
 
def koch(n, p1_x, p2_x, p1_y, p2_y):
  if n == 0:
    return
 
  s_x = (2*p1_x + p2_x) / 3
  s_y = (2*p1_y + p2_y) / 3
  t_x = (p1_x + 2*p2_x) / 3
  t_y = (p1_y + 2*p2_y) / 3
 
  u_x = (t_x - s_x)/2 - (t_y - s_y) * math.sqrt(3)/2 + s_x
  u_y = (t_x - s_x) * math.sqrt(3)/2 + (t_y - s_y)/2 + s_y
 
  koch(n-1, p1_x, s_x, p1_y, s_y)
  print (s_x, s_y)
  koch(n-1, s_x, u_x, s_y, u_y)
  print (u_x, u_y)
  koch(n-1, u_x, t_x, u_y, t_y)
  print (t_x, t_y)
  koch(n-1, t_x, p2_x, t_y, p2_y)
 
p1_x = 0.0
p1_y = 0.0
p2_x = 100.0
p2_y = 0.0
 
print (p1_x, p1_y)
koch(n, 0, 100, 0, 0)
print (p2_x, p2_y)
# 1人目は１個
a = 1

# 入力
b, c = map(int, input().split())

# 処理
answer = a + b + c

# 出力
print(answer)

### FIXED CODE ###

# 入力
N = int(input())

# 処理
total = 0
for i in range(1, N+1):
    total = total + i

# 出力
print(total)
import numpy as np
N, M, X = map(int, input().split())
C = []
A = np.zeros((N, M), dtype=int)
for i in range(N):
    c, *a = map(int, input().split())
    C.append(c)
    A[i] = a

S = np.sum(A, axis=0)
print(A)
print(S)
if True in (S < X):
    print(-1)
    exit(0)

mlt = [0]*12
C_ = []
for i in range(2**N):
    total = 0
    arr = np.zeros((M,),dtype=int)
    for j in range(N):
        if ((i>>j) & 1) == 1:
            total += C[j]
            arr += A[j]
    if True in (arr < X):
        continue
    C_.append(total)
print(min(C_))

### FIXED CODE ###

import numpy as np
N, M, X = map(int, input().split())
C = []
A = np.zeros((N, M), dtype=int)
for i in range(N):
    c, *a = map(int, input().split())
    C.append(c)
    A[i] = a

S = np.sum(A, axis=0)
if True in (S < X):
    print(-1)
    exit(0)

C_ = []
for i in range(2**N):
    total = 0
    arr = np.zeros((M,),dtype=int)
    for j in range(N):
        if ((i>>j) & 1) == 1:
            total += C[j]
            arr += A[j]
    if True in (arr < X):
        continue
    C_.append(total)
print(min(C_))
s = input()
a = []
for i in range(len(str(s))-2):
  a.append(int(abs(s[i]*100+s[i+1]*10+s[i+2]-753)))
print(min(a))

### FIXED CODE ###

s = input()
a = []
for i in range(len(s)-2):
  a.append(abs(int(s[i])*100+int(s[i+1])*10+int(s[i+2])-753))
print(min(a))
s = input()
s = input()
ans =''
for i in range(len(s)):
  if i ==1:
    ans+='1'
  elif i==0:
    ans+='0'
  elif i=='B':
      ans = ans[:-1]
print(ans)

### FIXED CODE ###

s = input()
ans =''
for i in s:
  if i =='1':
    ans+='1'
  elif i=='0':
    ans+='0'
  elif i=='B':
      ans = ans[:-1]
print(ans)
data = [int(i) for i in input().split()]
??
data.sort()
print("{0} {1} {2}".format(data[0],data[1],data[2]))

### FIXED CODE ###

data = [int(i) for i in input().split()]

data.sort()
print("{0} {1} {2}".format(data[0],data[1],data[2]))
N = input()
s = input()

N1 = int(N)/2

import math
N1= math.ceil(N1)
N1= int(N1)-1

list_s = list(s)
list_s.sort()
X = list_s[N1]

if X=='R':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

ABC = input().split()
list_ABC= list(ABC)

if list_ABC[0] == list_ABC[1] and list_ABC[0] == list_ABC[2]:
    print('Yes')
else:
    print('No')
n, l = int(input().split())

sn = []

for _ in range(n):
  sn.append(input())
  
sn = sorted(sn)

sn = join(sn)

print(sn)

### FIXED CODE ###

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

sn = []

for _ in range(1, n+1):
  sn.append(input())
  
sn = sorted(sn)

sn = ''.join(sn)

print(sn)
s = map(int, input().sprit)

for i in range(len(s)):
    if s[i] in s:
        print('Yes')
        break
    else: 
        print('No')


### FIXED CODE ###

s =input()

c = s.count('A')

if c == 3:
    print("No")
elif c == 0:
    print('No')
else: 
    print('Yes')
N = int(input())
S = list(input().split())
d = S[0]

for i in range(1, N):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))

### FIXED CODE ###

N = int(input())
S = input()
d = S[0]

for i in range(1, N):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))
import math
import numpy as np
from queue import Queue

n, m = [int(i) for i in input().split()]

root = np.zeros((n+1,n+1),dtype=np.int)

for i in range(m):
    a, b = [int(i) for i in input().split()]
    root[a][b] = 1
    root[b][a] = 1


check = [0 for _ in range(n+1)]
check[1] = 1

q = Queue()
q.put(1)

while ( not q.empty() ):
    now = q.get()
    for i in range(1,n+1):
        if(root[now][i] == 1 and check[i] == 0):
            check[i] = now
            q.put(i)

flag = 1
for i in range(2, n+1):
    if(check[i] == 0):
        flag = 0

if(flag == 1):
    print("Yes")
    for j in range(2, n + 1):
        print(check[j])
else:
    print("No")



### FIXED CODE ###

import math
from queue import Queue

n, m = [int(i) for i in input().split()]

root = [[] for _ in range(n+1)]

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

check = [0 for _ in range(n + 1)]
check[1] = 1

q = Queue()
q.put(1)

while (not q.empty()):
    now = q.get()
    for i in root[now]:
        if (check[i] == 0):
            check[i] = now
            q.put(i)

flag = 1
for i in range(2, n + 1):
    if (check[i] == 0):
        flag = 0

if (flag == 1):
    print("Yes")
    for j in range(2, n + 1):
        print(check[j])
else:
    print("No")
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def abc148c_snack():
    a, b = map(int, input().split())
    print(lcm(a, b))

abc148c_snack()

### FIXED CODE ###

def lcm(x, y):
    import math
    return (x * y) // math.gcd(x, y)

def abc148c_snack():
    a, b = map(int, input().split())
    print(lcm(a, b))

abc148c_snack()
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,k = li()
td = [tuple(li()) for _ in range(n)]

td.sort(key=lambda x:x[1], reverse=True)

kindset = set()
doublestack = []

ans = 0

for ti, di in td[:k]:
    if ti in kindset:
        doublestack.append((ti,di))
    
    else:
        kindset.add(ti)
        
    ans += di

ans += len(kindset) * len(kindset)
score = ans

# n-k個の要素に対して重複を排して交換
for ti, di in td[k:]:
    if ti in kindset:
        continue
    
    old_ti, old_di = doublestack.pop()
    
    score = score - old_di + di + 2*len(kindset) + 1
    
    ans = max(ans, score)
    
    kindset.add(ti)
    
print(ans)

### FIXED CODE ###

import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,k = li()
td = [tuple(li()) for _ in range(n)]

td.sort(key=lambda x:x[1], reverse=True)

kindset = set()
doublestack = []

ans = 0

for ti, di in td[:k]:
    if ti in kindset:
        doublestack.append((ti,di))
    
    else:
        kindset.add(ti)
        
    ans += di

ans += len(kindset) * len(kindset)
score = ans

# n-k個の要素に対して重複を排して交換
for ti, di in td[k:]:
    if ti in kindset:
        continue
    
    # すべてユニークだったら抜ける
    if len(doublestack) == 0:
        break
    
    #スコア再計算
    old_ti, old_di = doublestack.pop()    
    score = score - old_di + di + 2*len(kindset) + 1
    
    # 更新
    ans = max(ans, score)    
    kindset.add(ti)
    
    
print(ans)
A,B,C = map(int, input().split())
if A=B!=C or A!=B=C or B!=C=A:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A,B,C = map(int, input().split())
if A==B==C:
  print('No')
elif A==B or B==C or C==A:
  print('Yes')
else:
  print('No')
import math

def equation(A):
    n = len(A)
    for i in range(n):
        j=i
        while A[j][i]==0:
            j+= 1
        A[i], A[j] = A[j], A[i]
        A[i] = [e / A[i][i] for e in A[i]]
        for j in range(n):
            if j==i: continue
            tmp = A[j][i]
            for k in range(n+1):
                A[j][k] -= tmp * A[i][k]
    return

def f003():
    n=input()
    A=[]
    for i in range(n):
        seq = map(float, raw_input().split())
        for j in range(3):
            x = seq.pop(0)
            y = seq.pop(0)
            A.append([x, y, 1, -(x**2+y**2)])
        equation(A)

        x0, y0 = -A[0][3]/2, -A[1][3]/2
        r =((x-x0)**2 + (y-y0)**2)**.5
    return x0,y0,r

x0,y0,r = f003()
print "%.3f %.3f %.3f" %(x0, y0, r)

### FIXED CODE ###

import math
def equation(A):
  n=len(A)
  for i in range(n):
    j=i
    while A[j][i]==0:j+=1
    A[i],A[j]= A[j],A[i]
    A[i]=[e/A[i][i] for e in A[i]]
    for j in range(n):
      if j==i: continue
      tmp=A[j][i]
      for k in range(n+1):A[j][k]-=tmp*A[i][k]
  return
n=input()
for i in range(n):
  A=[]
  seq=map(float,raw_input().split())
  for j in range(0,6,2):
    x,y=seq[j:j+2]
    A+=[[x,y,1,-(x**2+y**2)]]
  equation(A)
  x0=-A[0][3]/2
  y0=-A[1][3]/2
  r=((x-x0)**2+(y-y0)**2)**.5
  print "%.3f %.3f %.3f" %(x0,y0,r)
# -*- coding utf-8 -*-

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

s =[str(input()) for i in range(n)]

s.sort()

print(*s,sep="")


### FIXED CODE ###

# -*- coding utf-8 -*-

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

x.sort() 
if x == [5,5,7]:
    print ("YES")
else:
    print("NO")
L = [input() for i in range(1, 6)]

li = list(filter(lambda x: x[-1] != "0", L))
last = int(sorted(li, key=lambda x: x[-1])[0])

t = sum(map(int, L)) - last
print(t + (10 - (t % 10)) + last)


### FIXED CODE ###

import math

L = [int(input()) for i in range(5)]

total = 0
sub = 0
for i in L:
    if i % 10 == 0:
        total += i
    else:
        rest = 10 - (i % 10)
        if rest > sub:
            sub = rest
        total += math.ceil(i / 10) * 10

print(total - sub)
def sackRace(p1, s1, p2, s2): 
      
    # Since starting points are always 
    # different, they will meet if following  
    # conditions are met. 
    # (1) Speeds are not same 
    # (2) Difference between speeds divide the 
    #     total distance between initial points.  
    return ( (s1 > s2 and (p2 - p1) % (s1 - s2) == 0)  
         or (s2 > s1 and (p1 - p2) % (s2 - s1) == 0)) 
p1 , s1=map(int , input().split()) 
p2 , s2=map(int , input().split())
t=int(input()) 
if sackRace(p1 , s1 , p2 , s2):
  print("NO")
else:
  print("YES)

### FIXED CODE ###

p1 , s1=map(int , input().split()) 
p2 , s2=map(int , input().split())
t=int(input()) 
if abs(p1-p2) > t*(s1-s2):
  print("NO")
else:
  print("YES")
a, b = map(int, input().split())
m = 0
for i in range(1, min(a, b)):
    if a%i==0 and b%i==0:
        m = i
print(int(a*b/m))

### FIXED CODE ###

a, b = map(int, input().split())
m = 0
for i in range(1, min(a, b)+1):
    if a%i==0 and b%i==0:
        m = i
print(int(a*b/m))
val = input()
valf=val[-1]
if(valf==s):
    print(val+"es")
else
    print(val+"s")

### FIXED CODE ###

val = input()
valf=val[-1]
if(valf=="s"):
    print(val+"es")
else:
    print(val+"s")
n = int(input())
h = [None] + list(map(int, input().split('')))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k == 2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])

### FIXED CODE ###

n = int(input())
h = [None] + list(map(int, input().split()))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k == 2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])
N, L = map(int, input().split())
lst = []

for i in range(N):
  lst.append(L + (i+1) - 1)
  
if L >= 0:
  print(sum(lst)-lst[0])
elif L+N-1 >= 0:
  print(sum(lst))
else:
  print(sum(lst) - lst[n-1])

### FIXED CODE ###

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

for i in range(N):
  lst.append(L + (i+1) - 1)
  
if L >= 0:
  print(sum(lst)-lst[0])
elif L+N-1 >= 0:
  print(sum(lst))
else:
  print(sum(lst) - lst[N-1])
def print_node(i, node):
    parent = -1 if node[1] == None else node[1]
    degree = len([x for x in node[0] if x != -1])
    sibling = -1 if parent == -1 else node[2]
    depth = node[3]
    height = node[4]
    t = 'root' if parent == -1 else 'leaf' if height == 0 else 'internal node'
    ans = "node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}".format(i, parent, sibling, degree, depth, height, t)
    print(ans)

n = int(input())

root = set([x for x in range(n)])
T = [None] * n
for x in range(n):
    i, l, r = list(map(int, input().split()))

    # children, parent, sibling, depth, height
    T[i] = [[l, r], None, None, None, None]
    root -= set([l, r])

def set_info(i, depth):
    node = T[i]
    node[3] = depth
    l = None
    r = None
    if node[0][0] != -1:
        l = T[node[0][0]]
        l[1] = i
        set_info(node[0][0], depth + 1)
    if node[0][1] != -1:
        r = T[node[0][1]]
        r[1] = i
        set_info(node[0][1], depth + 1)
    if l != None and r != None:
        l[2] = node[0][1]
        r[2] = node[0][0]
    node[4] = height(i)

def height(i):
    node = T[i]
    l = node[0][0]
    r = node[0][1]
    lh = None
    rh = None
    h = None
    if l != -1:
        lh = height(l)
    if r != -1:
        rh = height(r)
    if lh != None or rh != None:
        h = max(lh, rh)
    if h == None:
        return 0
    else:
        return 1 + h


r = root.pop()
T[r][1] = -1
set_info(r, 0)

for i, n in enumerate(T):
    print_node(i, n)

### FIXED CODE ###

def print_node(i, node):
    parent = -1 if node[1] == None else node[1]
    degree = len([x for x in node[0] if x != -1])
    sibling = -1 if node[2] == None else node[2]
    depth = node[3]
    height = node[4]
    t = 'root' if parent == -1 else 'leaf' if height == 0 else 'internal node'
    ans = "node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}".format(i, parent, sibling, degree, depth, height, t)
    print(ans)

n = int(input())

root = set([x for x in range(n)])
T = [None] * n
for x in range(n):
    i, l, r = list(map(int, input().split()))

    # children, parent, sibling, depth, height
    T[i] = [[l, r], None, None, None, None]
    root -= set([l, r])

def set_info(i, depth):
    node = T[i]
    node[3] = depth
    l = None
    r = None
    if node[0][0] != -1:
        l = T[node[0][0]]
        l[1] = i
        set_info(node[0][0], depth + 1)
    if node[0][1] != -1:
        r = T[node[0][1]]
        r[1] = i
        set_info(node[0][1], depth + 1)
    if l != None and r != None:
        l[2] = node[0][1]
        r[2] = node[0][0]

    node[4] = height(i)

def height(i):
    node = T[i]
    l = node[0][0]
    r = node[0][1]
    lh = None
    rh = None
    h = None
    if l != -1:
        lh = height(l)
    if r != -1:
        rh = height(r)
    if lh != None and rh != None:
        h = max(lh, rh)
    elif lh != None:
        h = lh
    elif rh != None:
        h = rh
    if h == None:
        return 0
    else:
        return 1 + h


r = root.pop()
T[r][1] = -1
set_info(r, 0)

for i, n in enumerate(T):
    print_node(i, n)
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)


### 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)
n=int(input())
a=[]
k=0

if n==0:
    print(0)

while k<1:
    if n==0:
        k=1
    else:
        if n%2==0:
            a.append(0)
            n=n/(-2)
        else:
            a.append(1)
            n=(n-1)/(-2)
            
for i in (reversed(a)):
    print(i,end="")

### FIXED CODE ###

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

if a%b==0:
    print(0)
else:
    print(1)
import numpy as np

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

H = np.array(list(map(int, input().split())))

dp = np.zero(N, dtype=int)

for i in range(1, N):
    start = max(0, i-K)
    dp[i] = min(dp[start:i]+np.abs(H[i]-H[start:i]))

print(dp[N-1])

### FIXED CODE ###

import numpy as np

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

H = np.array(list(map(int, input().split())))

dp = np.zeros(N, dtype=int)

for i in range(1, N):
    start = max(0, i-K)
    dp[i] = min(dp[start:i]+np.abs(H[i]-H[start:i]))

print(dp[N-1])
W=int(input())
H=int(input())
x=int(input())
y=int(input())
r=int(input())
if x-r<0 or y-r<0 or x+r>W or y+r>H :
    print("NO")
else:
    print("NO")



### FIXED CODE ###

W,H,x,y,r=map(int,input().split())
if x-r<0 or y-r<0 or x+r>W or y+r>H :
    print("No")
else:
    print("Yes")