N,M=map(int, input().split()) A=list(map(int, input().split())) B=list(map(int, input().split())) b=B[0] import heapq C=[];e=10**15 for i in range(N): c=-(e*A[i]-i)/b heapq.heappush(C,(c,i,0)) #print(C) for _ in range(M): c,i,r=heapq.heappop(C) print(i+1) if r+1==M: continue cc=-(e*A[i]-i)/B[r+1] heapq.heappush(C,(cc,i,r+1)) #print(C)