############################################################# 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**15 class YS(object): def __init__(self,bunsi, bunbo, idx): self.bunsi = bunsi self.bunbo = bunbo self.idx = idx def __lt__(self,other): if other.bunbo*self.bunsi == self.bunbo*other.bunsi: return other.idx > self.idx else: return other.bunbo*self.bunsi > self.bunbo*other.bunsi ############################################################# N,M = lmin() A = lmin() B = lmin() cnt = [1]*N hq = [] for i,a in enumerate(A): heappush(hq,YS(a,B[0],i)) ans = [] while True: ys = heappop(hq) idx = ys.idx ans.append(idx+1) if len(ans) == M: break heappush(hq,YS(A[idx],B[cnt[idx]],idx)) cnt[idx] += 1 for a in ans: print(a)