############################################################# import sys sys.setrecursionlimit(10**7) from heapq import heappop,heappush from collections import deque,defaultdict,Counter from bisect import bisect_left, bisect_right from itertools import product,combinations,permutations ipt = sys.stdin.readline def iin(): return int(ipt()) def lmin(): return list(map(int,ipt().split())) MOD = 998244353 L = 10**9 ############################################################# N,M = lmin() A = lmin() B = lmin() cnt = [1]*N hq = [] for i,a in enumerate(A): heappush(hq,(-a/B[0]*L+i,i)) ans = [] while len(ans) < M: _,idx = heappop(hq) ans.append(idx+1) heappush(hq,(-A[idx]/B[cnt[idx]]*L+idx,idx)) cnt[idx] += 1 for a in ans: print(a)