Harryxun/stf_run huggingface dataset:
def dfs(cur, par, g, d):
    pars[cur] = par
    for to in g[cur]:
        if to == par:
            continue
        d[to] = d[cur]+1
        md[cur] = max(md[cur], dfs(to, cur, g, d)+1)
    return md[cur]


n, u, v = map(int, input().split())
u -= 1
v -= 1
g = []
for i in range(n):
    g.append([])
for i in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
d = []
md = []
pars = []
f = []
for i in range(n):
    d.append(-1)
    md.append(0)
    pars.append(-1)
    f.append(False)
d[u] = 0
dfs(u, -1, g, d)
cur = v
while cur != u:
    f[cur] = True
    cur = pars[cur]
pars[u] = True
res = d[v]//2
for i in range(n):
    if f[i] and d[i]*2 < d[v]:
        for to in g[i]:
            if to == pars[i] or f[to]:
                continue
            res = max(res, md[to]+1+d[v]-d[i] - 1)
print(res)


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)


def dfs(cur, par, g, d):
    pars[cur] = par
    for to in g[cur]:
        if to == par:
            continue
        d[to] = d[cur]+1
        md[cur] = max(md[cur], dfs(to, cur, g, d)+1)
    return md[cur]


n, u, v = map(int, input().split())
u -= 1
v -= 1
g = []
for i in range(n):
    g.append([])
for i in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
d = []
md = []
pars = []
f = []
for i in range(n):
    d.append(-1)
    md.append(0)
    pars.append(-1)
    f.append(False)
d[u] = 0
dfs(u, -1, g, d)
cur = v
while cur != u:
    f[cur] = True
    cur = pars[cur]
f[u] = True
res = d[v]-1
for i in range(n):
    if f[i] and d[i]*2 < d[v]:
        for to in g[i]:
            if to == pars[i] or f[to]:
                continue
            res = max(res, md[to]+1+d[v]-d[i] - 1)
print(res)
n = int(input())
high = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    if max>=high[i]:
        ans += 1
        max = high[i]

print(ans)

### FIXED CODE ###

n = int(input())
high = [int(i) for i in input().split()]
ans = 0
max = 0
for i in range(n):
    if max<=high[i]:
        ans += 1
        max = high[i]

print(ans)
from sys import stdin
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

prime_list=[i for i in range(1,10001) if is_prime(i)]
oppai=[0]*10005
for i in range(3, 10001):
    if i in prime_list and (i+1)//2 in prime_list:
        oppai[i-1]=oppai[i-2]+1
    else:oppai[i-1]=oppai[i-2]
#print(oppai)
N=list(map(int,stdin.readline().strip().split()))[0]
for _ in range(N):
    count = 0
    a,b=map(int,(input().split()))
    if a==b:
        if a in  prime_list and ((a+1)//2) in  prime_list:
            count+=1
            print(count)
    else:
        if a>=2:
            bb=oppai[b-1]
            aa=oppai[a-2]
            count = bb - aa
            print(count)
        else:
            bb = oppai[b - 1]
            count = bb
            print(count)





### FIXED CODE ###

from sys import stdin
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
prime_list=[i for i in range(2,100000) if is_prime(i)]
oppai=[0]*100000
oppai[1]=0
before=1
for num in prime_list:
    if (num+1)//2 in prime_list:
        oppai[before:num - 2] = [oppai[before]] * (num-1 - before)
        oppai[num-1]=oppai[before]+1
    else:oppai[before:num-1]=[oppai[before]]*(num-before)
    before=num-1
oppai[99991:99999]=[oppai[99990]]*8
N=list(map(int,stdin.readline().strip().split()))[0]
for _ in range(N):
    count = 0
    a,b=list(map(int,stdin.readline().strip().split()))
    if a==b:
        bb = (oppai[b - 1])
        aa = (oppai[a - 2])
        count = bb - aa
        print(count)
    else:
        if a>=2:
            bb = oppai[b - 1]
            aa = oppai[a - 2]
            count = bb - aa
            print(count)
        else:
            bb = oppai[b - 1]
            count = bb
            print(count)
temp=list(map(int, input().split()))

N=temp[0]
X=temp[1]

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

ind=1
while np.sum(L[:ind])<=X and ind<N:
  ind+=1
  
print(ind)

### FIXED CODE ###

import numpy as np

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

N=temp[0]
X=temp[1]

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

ind=1
while np.sum(L[:ind])<=X and ind<=N:
  ind+=1
  
print(ind)
from math import gcd

def calc_half(n):
    return n//2

def lcm(L):
    ret=1
    for i in range(len(L)):
        ret=(ret*L[i])//gcd(ret,L[i])
    return ret

def f(n):
    ret=0
    while n%2==0:
        ret+=1
        n=n//2
    return ret

def g(L):
    l=[]
    for i in L:
        l.append(f(i))
    if len(set(l))==1:
        return False
    else:
        return True

n,m=map(int,input().split())
A=list(map(int,input().split()))
Auniq=list(set(A))
Ahalf=list(map(calc_half,Auniq))
lcm_ori=lcm(Auniq)
lcm_half=lcm(Ahalf)

if m<lcm_half or g(Auniq):
    print("0")
else:
    print(1+(m-lcm_half)//lcm_ori)

### FIXED CODE ###

from fractions import gcd

def calc_half(n):
    return n//2

def lcm(L):
    ret=1
    for i in range(len(L)):
        ret=(ret*L[i])//gcd(ret,L[i])
    return ret

def f(n):
    ret=0
    while n%2==0:
        ret+=1
        n=n//2
    return ret

def g(L):
    l=[]
    for i in L:
        l.append(f(i))
    if len(set(l))==1:
        return False
    else:
        return True

n,m=map(int,input().split())
A=list(map(int,input().split()))
Auniq=list(set(A))
Ahalf=list(map(calc_half,Auniq))
lcm_ori=lcm(Auniq)
lcm_half=lcm(Ahalf)

if m<lcm_half or g(Auniq):
    print("0")
else:
    print(1+(m-lcm_half)//lcm_ori)
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
 
if sum(A[i])>N:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

H,N = map(int,input().split())
A = list(map(int, input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")
x = int(input())

money = 100
year = 0

while(True):
  year += 1
  money += int(money*0.01)
  if money == x:
    print(year)
    break
  

### FIXED CODE ###

x = int(input())

money = 100
year = 0

while(money<x):
  year += 1
  money += money // 100
  
print(year)
N,M=map(int,input().split())
A = []

for _ in range(M):
  A.append(int(input())-1)

#初期化
dp=[0]*N
if A.count(0) == 0:
  dp[0]=1
if A.count(0) == 0 and A.count(1) == 0:
  dp[1]=2
elif A.count(0) ==1 and A.count(1) ==0:
  dp[1]=1

#dp
if N >= 3:
  for i in range(N-2):
    if A.count(i+2) ==1:
      dp[i+2] = 0
    elif A.count(i) == 0 and A.count(i+1) == 0:
      dp[i+2] = dp[i+1] + dp[i]
    elif A.count(i) == 0 and A.count(i+1) == 1:
      dp[i+2] = dp[i]
    elif A.count(i) == 1 and A.count(i+1) == 0:
      dp[i+2] = dp[i+1]
    else:
      dp[i+2] = 0
      
print(dp[N-1]%1000000007)

### FIXED CODE ###

N,M=map(int,input().split())
A = [0]*(N+1)

for _ in range(M):
  a = int(input())
  A[a] = 1

#初期化
dp=[0]*(N+1)
dp[0] = 1
if A[1] == 0:
  dp[1] = 1

#dp
for i in range(2,N+1):
  if A[i] == 0:
    dp[i] = dp[i-1] + dp[i-2]
      
print(dp[N]%1000000007)
h,a=divmod(int(input())/3600)
m,s=divmod(a/60)
print("{}:{}:{}").format(h,m,s)

### FIXED CODE ###

h,a=divmod(int(input()), 3600)
m,s=divmod(a,60)
print("{}:{}:{}".format(h,m,s))
A,B,K=map(int,input().split())
l=[]
p=A
q=B
if A>B:
    A=q
    B=p
for i in range(1,B+1):
    if A%i==0 and B%i==0:
        l.append(i)

print(l[K-1])


### FIXED CODE ###

A,B,C=map(int,input().split())
p=B//A
if p>=C:
  print(C)
else:
  print(p)
n = int(input())

def factorization(x):
   arr = []
   tmp = x
   for i in range(2, int(n**0.5+1)):
      if tmp % i == 0:
         cnt = 0
         while tmp % i == 0:
            tmp //= i
            cnt += 1
         arr.append([i, cnt])
   if tmp != 1:
      arr.append([i, cnt])
   if len(arr) == 0:
      arr.append([x, 1])
   return arr

if n == 1:
   print(0)
   exit()

ans = 0
for p, i in factorization(n):
   j = 0
   while i > j:
      j += 1
      i -= j
      ans += 1
print(ans)


### FIXED CODE ###

n = int(input())

from collections import Counter

factors = []
i = 2
while n > 1:
   if n < i * i:
      factors.append(n)
      break
   while n % i == 0:
      factors.append(i)
      n //= i
   i += 1

ans = 0
for cnt in Counter(factors).values():
   i = 1
   while cnt >= i:
      cnt -= i
      i += 1
      ans += 1
print(ans)
math import
r = int(input())
l＝2 * r * math.pi
print(l)

### FIXED CODE ###

import math
r = int(input())
t = 2 * r * math.pi
print(t)
import io
import sys
from math import ceil


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
4
0
0
0
0
'''


def MAIN():
  # T_IN()
  A()


def A():
  n = IN_I()

  l = [IN_I()]

  for i in range(0, n - 1):
    num = IN_I()

    # print("s:", l)
    # print("num:", num)
    if l[0] >= num:
      l.insert(0, num)
      continue

    inl = 0
    inr = len(l) - 1
    # 1, 2, 3, 4, 5
    for j in range(0, len(l)):
      if inr == inl:
        l.pop(inr)
        break

      mid = ceil((inr - inl) / 2)
      # print(mid, inl, inr)
      if l[mid] == num:
        inr = mid - 1
      elif l[mid] > num:
        inr = mid - 1
      else:
        inl = mid

    inl = 0
    inr = len(l) - 1
    # print("nuita:", l)
    for j in range(0, len(l)):
      mid = ceil((inr - inl) / 2)
      if mid == inl:
        if l[mid] >= num:
          l.insert(mid, num)
        else:
          l.insert(mid + 1, num)
        break
      elif l[mid] == num:
        l.insert(mid, num)
      elif l[mid] > num:
        inr = mid - 1
      else:
        inl = mid + 1

  # print(l)
  print(len(l))
  return None


def B():
  return None


def C():
  return None


MAIN()


### FIXED CODE ###

import io
import sys
from bisect import bisect_right, bisect_left
from collections import deque


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
7
1
0
3
4
1
2
1
'''


def MAIN():
  # T_IN()
  A()


def A():
  n = IN_I()

  l = deque([IN_I()])

  for i in range(0, n - 1):
    num = IN_I()

    idx = bisect_left(l, num)
    if idx == 0:
      l.appendleft(num)
    else:
      l[idx - 1] = num
    # print(l)

  print(len(l))
  return None


def B():
  return None


def C():
  return None


MAIN()
q=[]
qq=[]
def dfs(j,q,icnt,count,n,qq):
    if len(qq)==n:
        count+=1
#        print("1",n,j,icnt,count,q[j],qq)
        return count
    icnt+=1
    
    for j2 in q[j]:
        if not j2 in qq:
            qq.append(j2)
#            print("2",n,j,icnt,count,q[j],qq)
            count=dfs(j2,q,icnt,count,n,qq)
            qq.pop()
#        print("3",n,j,icnt,count,q[j],qq)
    return count

n,m=map(int,input().split())
q=[[0]*2 for i in range(m)]
for i in range(m):
    q[i]=list(map(int,input().split()))

#n=3
#m=3
#ab=[[1,2],[1,3],[2,3]]

#n=7
#m=7
#ab=[[1,3],[2,7],[3,4],[4,5],[4,6],[5,6],[6,7]]

q=[[]*2 for i in range(n)]
for i in range(m):
    if not q[ab[i][1]-1] in q[ab[i][0]-1]:
        q[ab[i][0]-1].append(ab[i][1]-1)    
    if not q[ab[i][0]-1] in q[ab[i][1]-1]:
        q[ab[i][1]-1].append(ab[i][0]-1)    
#print(q)    

count=0
j=0
qq=[j]
icnt=1
count=dfs(j,q,icnt,count,n,qq)
print(count)


### FIXED CODE ###

n,m=map(int,input().split())
a=[]

for i in range(m):
    ai,bi=map(int,input().split())
    a.append([ai,bi])
              
ni=[0]*n
nii=[]
    
def pathm(n,a,bi,pcnt,ni):
    if n==1:
        pcnt=pcnt+1
#        print("2:","n:",n,"bi:",bi,"pcnt:",pcnt)
        return pcnt
    else:
        n=n-1
        nii.append(bi)
        for mm in range(m):
            if a[mm][0]==bi and not a[mm][1] in nii:
#            if a[mm][0]==bi :
                ni[a[mm][1]-1]=1
#                print("1:","n:",n,"mm:",mm,"a[mm][1]:",a[mm][1],"pcnt:",pcnt)
                pcnt=pathm(n,a,a[mm][1],pcnt,ni)
            if a[mm][1]==bi and not a[mm][0] in nii:
#            if a[mm][1]==bi  and ni[a[mm][0]-1]==0 :
                ni[a[mm][0]-1]=1
#                ni[mm]=1
#                print("1:","n:",n,"mm:",mm,"a[mm][0]:",a[mm][0],"pcnt:",pcnt)
                pcnt=pathm(n,a,a[mm][0],pcnt,ni)
        nii.pop()
        return pcnt       
                
pcnt=0
pcnt1=pathm(n,a,1,pcnt,ni)
print(pcnt1)
class queue:
    head = tail = None
    size = 0
    def enqueue(self, x):
        if self.is_empty():
            self.head = self.tail = (x, None)
        else:
            self.tail[1] = (x, None)
            self.tail = self.tail[1]
        self.size += 1

    def dequeue(self):
        if not self.is_empty():
            self.head = self.head[1]
            self.size -=1

    def is_empty(self):
        return self.size == 0

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

s = queue()
t = list()
process = 0
for i in range(n):
    name, time = map(str, input().split())
    s.enqueue([name, int(time)])

while s.is_empty():
    diff = s[0][1] - q
    if diff <= 0:
        process += s[0][1]
        t.append([s[0][0], process])
        s.dequeue()
    else:
        process += q
        s.enqueue([s[0][0], diff])
        s.dequeue()
for i in t:
    print(i[0], i[1])

### FIXED CODE ###

class Node:
    elm = None
    nxt = None

    def __init__(self, elm, nxt):
        self.elm = elm
        self.nxt = nxt


class MyQueue:
    head = tail = None
    size = 0

    def enqueue(self, x):
        if self.is_empty():
            self.head = self.tail = Node(x, None)
        else:
            self.tail.nxt = Node(x, None)
            self.tail = self.tail.nxt
        self.size += 1

    def dequeue(self):
        n = self.head
        if not self.is_empty():
            self.head = self.head.nxt
            self.size -= 1
        return n.elm

    def is_empty(self):
        return self.size == 0

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

s = MyQueue()
result = list()
process = 0

for i in range(n):
    name, time = map(str, input().split())
    s.enqueue([name, int(time)])

while not s.is_empty():

    e = s.dequeue()
    diff = e[1] - q
    if diff <= 0:
        process += e[1]
        result.append([e[0], process])
    else:
        process += q
        s.enqueue([e[0], diff])
for i in result:
    print(i[0], i[1])
N = input()

a = []
for i in range(int(N)):
  a.append(input())

cnt = []
cnt2 = 0
while(int(N)-cnt2 != 0):
  s = a.count(a[0])-1
  cnt.append(s)
  a.remove(a[0])
  cnt2 += s+1
su = sum(cnt)
print(int(N)-su)

### FIXED CODE ###

N = input()

a = []
for i in range(int(N)):
  a.append(input())

cnt = {s:(a.count(s)-1) for s in a}

print(int(N)-sum([int(j) for j in cnt.values()]))
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M :
  print(0)
else:
  length = [0] * (M-1)
  for i in range(M-1):
    length[i](X[i+1]-X[i])
  length.sort()
  print(sum(length[:M-N]))

### FIXED CODE ###

N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))
if N >= M :
  print(0)
else:
  length = [0] * (M-1)
  for i in range(M-1):
    length[i] = (X[i+1]-X[i])
  length.sort()
  print(sum(length[:(M-N)]))
n = int(input())
lis = list(map(int,input().split()))
cou = 0
co = 0
ans1 = 0
ans2 = 0
for i in range(n):
  cou += lis[i]
  co += lis[i]
  if cou <= 0 and i % 2 == 0:
    ans1 += (1 -cou)
    cou = 1
  if cou => 0 and i % 2 == 1:
    ans1 += (cou +1)
    cou = -1
  if co => 0 and i % 2 == 0:
    ans2 += (co +1)
    co = -1
  if co <= 0 and i % 2 == 1:
    ans2 += (1 -co)
    co = 1
print(min(ans1,ans2))

### FIXED CODE ###

n = int(input())
lis = list(map(int,input().split()))
cou = 0
co = 0
ans1 = 0
ans2 = 0
for i in range(n):
  cou += lis[i]
  co += lis[i]
  if cou <= 0 and i % 2 == 0:
    ans1 += (1 -cou)
    cou = 1
  if cou >= 0 and i % 2 == 1:
    ans1 += (cou +1)
    cou = -1
  if co >= 0 and i % 2 == 0:
    ans2 += (co +1)
    co = -1
  if co <= 0 and i % 2 == 1:
    ans2 += (1 -co)
    co = 1
print(min(ans1,ans2))
t = []
for a in range(2,10000):
  for n in range(2,a):
    if a % n == 0:
      break
  else:
    t.append(a)

while True:
  try:
    z = int(input())
    for w in range(1000000):
     if t[w] > z:
       break

    print len(t[0:w])
  except EOFError:
    break

### FIXED CODE ###


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
import sys
 
list=1000000*[1]
 
list[0] = 0
list[1] = 0
for i in range(1,1000000):
    if list[i] == 1:
        for j in range(i*i,1000000,i):
            list[j] = 0
 
for i in range(2,1000000):
    list[i] += list[i-1]
     
for line in sys.stdin:
    a = int(line)
    print list[a]
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
Q = int(input())
BC = [tuple(map(int, input().split())) for _ in range(Q)]

for i in range(Q):
    temp = [A == BC[i][0]] * BC[i][1]
    A = A + temp
    print(sum(A))


### FIXED CODE ###

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
Q = int(input())
BC = [tuple(map(int, input().split())) for _ in range(Q)]
total = sum(A)

A_dict = {}
for a in A:
    if a in A_dict:
        A_dict[a] += 1
    else:
        A_dict[a] = 1

for i in range(Q):
    b = BC[i][0]
    c = BC[i][1]

    if b in A_dict:
        total += (c - b) * A_dict[b]
        print(total)
        
        if c in A_dict:
            A_dict[c] += A_dict[b]
        else:
            A_dict[c] = A_dict[b]
        A_dict[b] = 0
    
    else:
        print(total)
N = int(input())

sum = 0
for i in range (1,N+1):
    if N//i == N%i:
        sum += i
array.append(sum)
print(sum)

### FIXED CODE ###

N = 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

divisors = make_divisors(N)

count = 0
for divisor in divisors:
    m = divisor-1
    if m and (N//m == N%m):
        count += m
print(count)
from math import log2

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

maxdig = int(log2(max(A)))


ans = 0
for i in range(maxdig, -1, -1):
  d = 2**i
  cnt1 = 0
  for j in range(N):
    if A[j]//d > 0:
      cnt1 += 1
      A[j] -= d
  ans += (cnt1*(N-cnt1)*d)%1000000007

print(ans)

### FIXED CODE ###

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

maxdig = 60
mod = 10**9+7

ans = 0
for i in range(60+1):
  cnt1 = sum([1 for a in A if (a >> i) & 1])
  ans += (cnt1*(N-cnt1)*(1<<i))
  ans = ans%mod

print(ans)
n = int(input())

h = [int(x) for x in input().split()]

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

print(count)

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
count = 0
max = 0
for i in range(N):
    if max <= h[i]:
        max = h[i]
        count += 1
print(count)
N,D=map(int,input().split());print(-(-N//(2*D+1)))

### FIXED CODE ###

r=int(input());print(3*r**2)
n, m = map(int, input().split())
p = [[i] + list(map(int, input().split())) for i in range(m)]
r = [0]*n
p.sort(key=lambda x:(x[1],x[2]))
j = 0
k = 0
q = []
for i in range(m):
    if j==p[i][1]:
        k+=1
    else:
        k = 1
    q.append([p[i][0],k])
    j = p[i][1]
q.sort()
p.sort()
for i in range(m):
    print(f"{p[i][1]:0>6}{q[i][1]:0>6}")

### FIXED CODE ###

import collections
import bisect
n,m = map(int, input().split())
p = [list(map(int,input().split())) for i in range(m)]
a = collections.defaultdict(list)
for x,y in sorted(p):
  a[x]+=[y]
for x,y in p:
  print("%06d%06d"%(x,bisect.bisect(a[x],y)))
n = int(input())
t_state, x_state, y_state = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    td = t - t_state
    if  td < d or td%2 != d%2
        print("No")
        exit()
    t_state, x_state, y_state = t, x, y
print("Yes")
    

### FIXED CODE ###

n = int(input())
t_state, x_state, y_state = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    td = t - t_state
    if  td < d or td%2 != d%2:
        print("No")
        exit()
    t_state, x_state, y_state = t, x, y
print("Yes")
import sys
d={"Vacant":0, "Male":1, "Female":-1}

N=int(input())
M=[2 for _ in range(N+1)]
print(0, flush=True)
M[0]=d[input()]
M[N]=M[0]

def search(l,r):
    if r - l == 2:
        print(l+1)
        sys.exit()
    print((l+r)//2, flush=True)
    return d[input()]
l=0
r=N
while True:
    M[(r+l)//2] = search(l,r)
    if M[(r+l)//2] == 0:
        print((r+l)//2)
        sys.exit()
    elif M[(r+l)//2] != M[l]:
            r=(r+l)//2
    elif M[(r+l)//2] != M[r]:
            l=(r+l)//2
    else:
        print("something wrong")
        sys.exit()

### FIXED CODE ###

import sys
d={"Vacant":0, "Male":1, "Female":-1}

N=int(input())
M=[2 for _ in range(N+1)]
print(0, flush=True)
M[0]=d[input()]
M[N]=M[0]

def search(l,r):
    if r - l == 2:
        print(l+1)
        sys.exit()
    print((l+r)//2, flush=True)
    return d[input()]
l=0
r=N
while True:
    m=(r+l)//2
    M[m] = search(l,r)
    if M[m] == 0:
        print(m)
        sys.exit()
    if (m-l) % 2 == 0:
        if M[m] == M[l]:
            l=m
        else:
            r=m
    else:
        if M[m] == M[l]:
            r=m
        else:
            l=m
n = int(input())
b = int(input())
c = int(input())
if n == 1:
    ("Hello World")
else:
    a = b + c
    print(a)

### FIXED CODE ###

n = int(input())
if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)
a, b, c, b = map(int, input().split())
if a * b > c * b:
    print(a * b)
elif a * b < c * b:
    pritn(c * b)
else:
    print(a * b)

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if a * b > c * d:
    print(a * b)
elif a * b < c * d:
    print(c * d)
else:
    print(a * b)
i=0
while True:
 i+=1
 a=input()
 if a==0:
  break
 else:
  print("Case "+str(i)": "+str(a))

### FIXED CODE ###

i=0
while True:
 i+=1
 a=input()
 if a==0:
  break
 else:
  print("Case "+str(i)+": "+str(a))
N = int(input())
l = []

def main(n):
  global l
  i = 1
  if n == 1:
    l.append(1)
    return l
  else:
    while True:
      tmp = i*(i+1)//2
      if tmp >= n:
        l.append(i)
        if n-i == 0:
          return l
        else:
          return main(n-i)
      i += 1
        
li = main(N)
li.sort()
for n in li:
  print(n)

### FIXED CODE ###

import sys
N = int(input())
l = []

def main(n):
  global l
  i = 1
  while True:
    tmp = i*(i+1)//2
    if tmp >= n:
      l.append(i)
      if n-i == 0:
        return l
      else:
        return main(n-i)
    i += 1
    
sys.setrecursionlimit(10000)
li = main(N)
for n in li:
  print(n)