from heapq import heappop,heappush n,m = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) inf = 10**20 h = [] num = [0]*n for i in range(n): heappush(h,[-inf*A[i]//B[0],i]) ans = [] for _ in range(m): x,ind = heappop(h) ans.append(ind+1) num[ind] += 1 if num[ind] >= m: continue heappush(h,[-inf*A[ind]//B[num[ind]],ind]) for i in ans: print(i)