Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

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

ans = -float('inf')
v = []
for n in range(N):
    loop, score = 0, 0
    t = n
    for i in range(min(N, K)):
        n = P[n]-1
        score += C[n]
        ans = max(ans, score)
        if n == t:
            loop = i+1
            break
    v.append((loop, score))

for n in range(N):
    loop, score = v[n]
    if loop > 0 and score > 0:
        r = (K-1)//loop
        nscore = r*score
        for i in range(K-r*loop):
            n = P[n]-1
            nscore += C[n]
            ans = max(nscore, ans)
print(ans)


### FIXED CODE ###

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

ans = -float('inf')
v = []
for n in range(N):
    loop, score = 0, 0
    t = n
    for i in range(min(N, K)):
        n = P[n]-1
        score += C[n]
        ans = max(ans, score)
        if n == t:
            loop = i+1
            break
    v.append((loop, score))

for n in range(N):
    loop, score = v[n]
    if loop > 0 and score > 0:
        r = (K-1)//loop
        nscore = r*score
        for i in range(K-r*loop):
            n = P[n]-1
            nscore += C[n]
            ans = max(nscore, ans)
print(ans)
### BUGGY CODE ###

from sys import stdin, setrecursionlimit
from functools import lru_cache

setrecursionlimit(10 ** 9)
INF = 1 << 60


def input():
    return stdin.readline().strip()


MOD = 1000000007

N = int(input())
G = [[] for _ in range(N)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)

childs = [0] * N
seen = [False] * N


def dfs1(v):
    seen[v] = True
    c = 0
    for nv in G[v]:
        if not seen[nv]:
            dfs1(nv)
            c += childs[nv] + 1
    childs[v] = c
    return


dfs1(0)

numer = 0
seen = [False] * N

@lru_cache(maxsize=None)
def power(x, y, z):
    return pow(x, y, z)

def dfs2(v):
    global numer
    seen[v] = True
    nodes = []
    for nv in G[v]:
        if seen[nv]:
            nodes.append(N - childs[v] - 1)
        else:
            nodes.append(childs[nv] + 1)
    if len(nodes) > 1:
        this_numer = power(2, N - 1, MOD) - (sum(power(2, n, MOD) - 1 for n in nodes) + 1)
        numer = (numer + this_numer) % MOD
    for nv in G[v]:
        if not seen[nv]:
            dfs2(nv)
    return


dfs2(0)
denom = power(2, N, MOD)
ans = numer * pow(denom, MOD - 2, MOD) % MOD
print(ans)


### FIXED CODE ###

from sys import stdin, setrecursionlimit
from collections import deque

setrecursionlimit(10 ** 9)
INF = 1 << 60


def input():
    return stdin.readline().strip()


MOD = 1000000007
N = int(input())
G = [[] for _ in range(N)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)

pow2 = [1] * (N + 1)
for i in range(N):
    pow2[i + 1] = pow2[i] * 2 % MOD

order = []
parent = [-1] * N

stack = deque([0])
while stack:
    v = stack.pop()
    order.append(v)
    for nv in G[v]:
        if parent[v] != nv:
            parent[nv] = v
            stack.append(nv)

numer = 0
nums = [0] * N

for v in reversed(order):
    tmp = 1
    for nv in G[v]:
        if parent[v] != nv:
            c = nums[nv] + 1
            nums[v] += c
            tmp += pow2[c] - 1
    tmp += pow2[N - nums[v] - 1] - 1
    numer = (numer + pow2[N - 1] - tmp) % MOD

denom = pow2[N]
ans = numer * pow(denom, MOD - 2, MOD) % MOD
print(ans)
### BUGGY CODE ###

from heapq import heappush, heappop

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

abl = []


def main():
    for i in range(n):
        abl.append(tuple(map(int, input().split())))

    abl.sort()

    ans = 0
    q = []

    for i in range(1, m+1):
        for j, ab in enumerate(abl):
            if ab[0] == i:
                heappush(q, -ab[1])
        if q:
            ans += -heappop(q)

    return ans


print(main())


### FIXED CODE ###

from heapq import heappush, heappop

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

abl = []
for i in range(n):
    abl.append(tuple(map(int, input().split())))
abl.sort()

q = []
count = 0
ans = 0

for i in range(1, m+1):
    while count < n:
        a, b = abl[count]
        if a > i:
            break
        heappush(q, -b)
        count += 1
    if q:
        ans += -heappop(q)

print(ans)
### BUGGY CODE ###

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

ans = 0
count = 1

while(True):
  if K**count <= N < K**(count+1):
    ans = count
    break

  count += 1

print(ans+1)

### FIXED CODE ###

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

ans = 0
count = 0

while(True):
  if K**count <= N < K**(count+1):
    ans = count
    break

  count += 1

print(ans+1)
### BUGGY CODE ###

N = int(input())
A = []
ans = 0
for _ in range(N):
  B = input()
  if not B in A:
    ans += 1
    A.append(B)
print(ans)

### FIXED CODE ###

N = int(input())
A = []
for _ in range(N):
  A.append(input())
B = list(set(A))
print(len(B))
### BUGGY CODE ###

s=input()
n=len(s)
count=0
a=[0 for i in range(n)]
for i in range(3,n):
    a[i]=10**i%2019
if n<4:
    print(0)
else:
    for i in reversed(range(2,n)):
        k=int(s[i-2:i+1])
        h=3
        for j in reversed(range(0,i-2)):
            k=k+a[h]*int(s[j])
            h+=1
            if k%2019==0:
                count+=1
    print(count)

### FIXED CODE ###

import math
s=input()
n=len(s)
count=0
a=[0 for i in range(2019)]
a[0]=1
k=0
b=[0 for i in range(n)]
b[0]=1
for i in range(1,n):
    b[i]=b[i-1]*10%2019
for i in reversed(range(0,n)):
    k+=(b[n-i-1])*int(s[i])%2019
    a[k%2019]+=1        
for i in range(len(a)):
    if a[i]>=2:
        count+=(a[i])*(a[i]-1)//2
print(count)
### BUGGY CODE ###

import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
S = input()

ans = 0
for a,b,c in itertools.product(map(str,range(10)),repeat=3):
    aa = False
    bb = False
    for s in S:
        if aa == False and s == a:
            aa = True
            continue
        if bb == False and aa == True and s == b:
            bb = True
            continue
        if aa == True and bb == True and s == c:
            ans += 1
            break

print(ans)

### FIXED CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
S = input()

ans = 0
for a,b,c in itertools.product(map(str,range(10)),repeat=3):
    aa = False
    bb = False
    for s in S:
        if aa == False and s == a:
            aa = True
            continue
        if bb == False and aa == True and s == b:
            bb = True
            continue
        if aa == True and bb == True and s == c:
            ans += 1
            break

print(ans)
### BUGGY CODE ###

[H,N] = [int(s) for s in input().rstrip().split(' ')] #HもんすたーのHP,N魔法の種類
L_1 = []
L_2 = []
for i in range(N):
    A_i = [int(s) for s in input().rstrip().split(' ')] #[攻撃力,消費魔力]
    L_1.append(A_i[0])
    L_2.append(A_i[1])
M = [10**8 for x in range(H+max(L_1))] #最小消費魔力
M[0] = 0
for k in range(1,H+max(L_1)):
  for n in range(N):
     M[k] = min(M[k],L_2[n]+M[max(k-L_1[n],0)])
print(min(M[H:]))

### FIXED CODE ###

[H,N] = [int(s) for s in input().rstrip().split(' ')] #HもんすたーのHP,N魔法の種類
L_1 = []
L_2 = []
for i in range(N):
    A_i = [int(s) for s in input().rstrip().split(' ')] #[攻撃力,消費魔力]
    L_1.append(A_i[0])
    L_2.append(A_i[1])
M = [10**8 for x in range(H+max(L_1))] #最小消費魔力
M[0] = 0
for k in range(1,H+max(L_1)):
  for n in range(N):
     M[k] = min(M[k],L_2[n]+M[max(k-L_1[n],0)])
print(min(M[H:]))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n, d, a = map(int, input().split())
xh = sorted([tuple(map(int, input().split()))for _ in range(n)])

x, h = xh[0]
cnt = -(-h//a)
ans = cnt
bomb_list = [(x+2*d, cnt*a)]
effective_bomb_idx = 0
for x, h in xh[1:]:
    idx = effective_bomb_idx
    for bomb in bomb_list[idx:]:
        area, damage = bomb
        if x <= area:
            h -= damage
            if h <= 0:
                break
        else:
            effective_bomb_idx += 1

    if 0 < h:
        cnt = -(-h//a)
        bomb_list.append((x+2*d, cnt*a))
        ans += cnt

print(ans)

### FIXED CODE ###

import sys
import bisect
input = sys.stdin.readline
n, d, a = map(int, input().split())
xh = sorted([tuple(map(int, input().split()))for _ in range(n)])
x_list = [x for x, h in xh]

damage = [0]*(n+1)
ans = 0
for i in range(n):
    x, h = xh[i]
    h -= damage[i]
    if h <= 0:
        damage[i+1] += damage[i]
        continue
    cnt = -(-h//a)
    ans += cnt
    damage[i] += cnt*a
    end_idx = bisect.bisect_right(x_list, x+2*d)
    damage[end_idx] -= cnt*a
    damage[i+1] += damage[i]

print(ans)
### BUGGY CODE ###

from collections import deque
def resolve():
    N, M, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    read = deque()
    w = 0

    if sum(A) + sum(B) <= K:
        print(len(A) + len(B))
        return

    while w <= K:        
        if len(A) == 0 and len(B) == 0:
            break

        if len(A) == 0:
            if w + B[0] <= K:
                read.append(B[0])
                w += B[0]
            B.pop(0)
            continue

        if len(B) == 0:
            if w + A[0] <= K:
                read.append(A[0])
                w += A[0]
            A.pop(0)
            continue

        if A[0] < B[0] or len(B) == 0:
            if w + A[0] <= K:
                read.append(A[0])
                w += A[0]
            A.pop(0)
        else:
            if w + B[0] <= K:
                read.append(B[0])
                w += B[0]
            B.pop(0)

    print(len(read))


resolve()


### FIXED CODE ###

def resolve():
    N, M, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    ans = 10 ** 10
    t = 0

    for i in range(M):
        t += B[i]
    j = M
    ans = 0
    for i in range(N+1):
        while j > 0 and t > K:
            j -= 1
            t -= B[j]
        
        if t > K:
            break
        
        ans = max(ans, i+j)
        
        if i == N:
            break
        t += A[i]
    
    print(ans)

resolve()
### BUGGY CODE ###

from bisect import bisect_left

N = int(input())

A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
num_a = 0
num_c = 0
res = 0

for b in B:
    num_a = bisect_left(A, b) # a < b となるAの要素数
    pre_num_c = bisect_left(C, b)
    num_c = N - pre_num_c # c > b となるAの要素数
    if pre_num_c != N and C[pre_num_c] == b:
        num_c -= C.count(b)
    res += num_a * num_c
print(res)


### FIXED CODE ###

from bisect import bisect_left
from collections import defaultdict

N = int(input())

A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
num_a = 0
num_c = 0
res = 0
pre_b = -1

dict_C = defaultdict(int)


for b in B:
    if b == pre_b:
        res += num_a * num_c
        continue
    num_a = bisect_left(A, b) # a < b となるAの要素数
    pre_num_c = bisect_left(C, b)
    num_c = N - pre_num_c # c > b となるAの要素数
    if pre_num_c != N and C[pre_num_c] == b:
        num_c = N - bisect_left(C, b+1)
    res += num_a * num_c
    pre_b = b
print(res)
### BUGGY CODE ###

N = int(input())

p = 1

for i in range(1, N+1):
    p *= i

print(p % (10 ** 9 + 7))

### FIXED CODE ###

N = int(input())

p = 1
div = 10 ** 9 + 7
for i in range(1, N+1):
    p = (p * i) % div

print(p % div)
### BUGGY CODE ###

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

c=0
flag=True
while(flag):
    for i in range(len(a)):
        flag=False
        if a[i]%2==0:
            a[i]//=2
            c+=1
            flag = True
            break
            
print(c)
    

### FIXED CODE ###

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

c=0
for i in range(len(a)):
    while a[i]%2==0:
        c+=1
        a[i]//=2
print(c)
### BUGGY CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(m):
  a[a.index(max(a))]//=2
print(sum(a))


### FIXED CODE ###

import bisect

n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
for i in range(m):
  t=a[-1]
  t//=2
  a.pop()
  bisect.insort_left(a,t)
  #print(i,a)
print(sum(a))
### BUGGY CODE ###

from functools import reduce
from itertools import accumulate
from operator import add


def solve(string):
    n, *ab = map(int, string.split())
    ab = reduce(add, sorted(zip(*[iter(ab)] * 2), key=lambda x: x[1]))
    return "Yes" if all([a <= b for a, b, in zip(accumulate(ab[::2]), ab[1::2])]) else "No"


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(n)])))


### FIXED CODE ###

def solve(string):
    n, *ab = map(int, string.split())
    ab = sorted(zip(*[iter(ab)] * 2), key=lambda x: (x[1], x[0]))
    past = 0
    for a, b in ab:
        past += a
        if past > b:
            return "No"
    return "Yes"


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(n)])))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(100000000)
N = int(input())
C = [int(input())]
cindex = {C[0]:[0]}
mod = 7 + 10 ** 9
counter = 0
for _ in range(N-1):
    c = int(input())
    if c != C[-1]:
        C.append(c)
        counter += 1
        if c in cindex:
            cindex[c].append(counter)
        else:
            cindex[c] = [counter]

def variation(i, memo = {}):
    if i == len(C)-1: return 1
    try:
        return memo[i]
    except KeyError:
        total = 0
        L = cindex[C[i]]
        for l in L:
            if l > i:
                total += variation(l, memo) #lまで塗る
                total %= mod
                break
        total += variation(i + 1, memo)
        total %= mod
        memo[i] = total
        return total
 
memo = {}
print(variation(0, memo))

### FIXED CODE ###

N = int(input())
C = [int(input())]
cindex = {C[0]: 0}
mod = 7 + 10 ** 9
counter = 0
for _ in range(N-1):
    c = int(input())
    if c != C[-1]:
        C.append(c)
        counter += 1
        if c not in cindex:
            cindex[c] = counter

DP = [[0, 1] for i in range(len(C))]
for i in range(1, len(C)):
    if cindex[C[i]] == i:
        DP[i][1] = DP[i-1][1]
    else:
        DP[i][0] = DP[cindex[C[i]]][1] 
        DP[i][1] = DP[i][0] + DP[i-1][1]
        DP[i][1] %= mod
        cindex[C[i]] = i
print(DP[-1][1])
### BUGGY CODE ###

S = input()

mod = 10**9+7
N = len(S)

s = S[-1]
dp = [0]*13
if s=="?":
    dp[:10] = [1]*10
else:
    dp[int(s)] = 1

dig = 1
for c,s in enumerate(S[:-1][::-1],1):
    dig = dig*10%13
    dp2 = [0]*13
    if s=="?":
        for i in range(10):
            for j,n in enumerate(dp):
                dp2[(i*dig+j)%13] += n
    else:
        i = int(s)
        for j,n in enumerate(dp):
            dp2[(i*dig+j)%13] += n
    dp = [n%mod for n in dp2]
print(dp[5])

### FIXED CODE ###

S = input()

mod = 10**9+7
N = len(S)
ans = 0

memo = {}
for i in range(1000):
    s = str(i).zfill(3)
    memo[s] = [0 for _ in [0]*13]
    memo[s][i%13] = 1

def rep_Q_count(s):
    memo[s] = [0 for _ in [0]*13]
    for q in range(10):
        s2 = s.replace("?",str(q),1)
        for i,n in enumerate(memo[s2]):
            memo[s][i] += n

for i in range(100):
    s = str(i).zfill(2)
    rep_Q_count(s+"?")
    rep_Q_count(s[0]+"?"+s[1])
    rep_Q_count("?"+s)
for i in range(10):
    s = str(i)
    rep_Q_count(s+"??")
    rep_Q_count("?"+s+"?")
    rep_Q_count("??"+s)
rep_Q_count("???")

s0 = S[max(0,N-3):N].zfill(3)
dp = memo[s0][:]
for i in range(1,(N-1)//3+1):
    s = S[max(0,N-(i+1)*3):N-i*3].zfill(3)
    j = i%2
    tmp = memo[s]
    dp2 = [0]*13
    for k,n in enumerate(tmp):
        for l,m in enumerate(dp):
            dp2[(l+k*((-1)**j))%13] += n*m
    dp = dp2
    for i in range(13):
        dp[i] %= mod
print(dp[5])
### BUGGY CODE ###

from collections import defaultdict
N = int(input())
A = list(map(int,input().split()))

def is_ok(k):
    length = 0
    mem = defaultdict(lambda: 0)
    for a in A:
        if a > length:
            length = a
            continue
        dels = []
        for b in mem.keys():
            if b > a:
                dels.append(b)
        while a > 0 and mem[a] >= k-1:
            dels.append(a)
            a -= 1
        if a == 0:
            return False
        mem[a] += 1
        length = a
        for b in dels:
            del mem[b]
    return True

ng = 0
ok = N
while ok-ng > 1:
    m = (ok+ng+1)//2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)

### FIXED CODE ###

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

def is_ok(k):
    length = 0
    mem = {}
    for a in A:
        if a > length:
            length = a
            continue
        dels = []
        for b in mem.keys():
            if b > a:
                dels.append(b)
        while a > 0:
            if a in mem and mem[a] >= k-1:
                dels.append(a)
            else:
                break
            a -= 1
        if a in mem:
            mem[a] += 1
        else:
            mem[a] = 1
        if a == 0 or mem[a] >= k:
            return False
        length = a
        for b in dels:
            del mem[b]
    return True

ng = 0
ok = N
while ok-ng > 1:
    m = (ok+ng+1)//2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)
### BUGGY CODE ###

from functools import lru_cache
import sys
sys.setrecursionlimit(10**6)

def main(N, M, a_list):
    div = 10**9 + 7
    @lru_cache(maxsize=None)
    def fib(n):
        if n in a_list:
            return 0
        else:
            if n == -1:
                return 0
            elif n == 0 or n == 1:
                return 1
            else:
                return fib(n-2) % div + fib(n-1) % div
    
    
    print(fib(N) % div )


if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(input()))

    main(N, M, a_list)


### FIXED CODE ###

def main(N, M, a_list):
    div = 10**9 + 7

    a_set = set(a_list)
    
    dp = {}
    dp[0] = 1
    if 1 in a_set:
        dp[1] = 0
    else:
        dp[1] = 1

    for i in range(N):
        if i+2 in a_set:
            dp[i+2] = 0
        else:
            dp[i+2] = (dp[i+1] + dp[i])
    
    print(dp[N] % div)


if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(input()))

    main(N, M, a_list)
### BUGGY CODE ###

import sys

count = 0

inarr = set()

for line in sys.stdin:
    n = int(line)

    if n == 2:
        inarr.add(n)
        continue

    jdg = True
    for i in range(2, n):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        inarr.add(n)

print(len(inarr))



### FIXED CODE ###

import sys

count = 0

number = int(input())

for line in sys.stdin:
    n = int(line)
    if n == 2:
        count += 1
        continue

    if n % 2 == 0:
        continue

    jdg = True
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        count += 1

print(count)
### BUGGY CODE ###

from math import ceil

N = int(input())
prv_t, prv_a = map(int,input().split())
ans = prv_t + prv_a
for _ in range(N-1):
  t,a = map(int,input().split())
  
  x = ceil(ans/(t+a))
  while prv_t > t*x or prv_a > a*x:
    x+=1
  ans = (t+a)*x
  prv_t, prv_a = t*x, a*x
print(ans)

### FIXED CODE ###

from math import ceil

N = int(input())
prv_t, prv_a = 1, 1
for _ in range(N):
  t,a = map(int,input().split())
  x = max(-(-prv_t//t), -(-prv_a//a))
  prv_t, prv_a = t*x, a*x
print(prv_t+prv_a)
### BUGGY CODE ###

from itertools import product, chain

x, y, z, k = list(map(int, input().split(" ")))
a = sorted(list(map(int, input().split(" "))))
b = sorted(list(map(int, input().split(" "))))
c = sorted(list(map(int, input().split(" "))))

apb_sorted = sorted([a + b for a, b in product(a, b)])
ans_list = sorted(
    list(chain.from_iterable([[_c + ab for ab in apb_sorted] for _c in c[:k]]))
)
it = reversed(ans_list)
for _ in range(k):
    print(next(it))


### FIXED CODE ###

from itertools import product, chain

x, y, z, k = list(map(int, input().split(" ")))
a = sorted(list(map(int, input().split(" "))))
b = sorted(list(map(int, input().split(" "))))
c = sorted(list(map(int, input().split(" "))))

apb_sorted = sorted([a + b for a, b in product(a, b)])[-k:]
ans_list = sorted(
    list(chain.from_iterable([[_c + ab for ab in apb_sorted] for _c in c[:k]]))
)
it = reversed(ans_list)
for _ in range(k):
    print(next(it))