from heapq import heappop,heappush from decimal import Decimal n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) hq = [] for i in range(n): heappush(hq,(Decimal(-a[i])/Decimal(b[0]),i,0)) while True: _,i,j = heappop(hq); print(i+1); m -= 1 if m==0: break heappush(hq,(Decimal(-a[i])/Decimal(b[j+1]),i,j+1))