N,M=map(int, input().split()) A=list(map(int, input().split())) B=list(map(int, input().split())) from decimal import Decimal b=B[0] import heapq C=[];e=10**5 for i in range(N): x=-(e*A[i]-i) c=Decimal(x)/Decimal(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 x=-(e*A[i]-i) cc=Decimal(x)/Decimal(B[r+1]) heapq.heappush(C,(cc,i,r+1)) #print(C)