from heapq import heappop,heappush from fractions import Fraction 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,(Fraction(-a[i],b[0]),i,0)) while True: _,i,j = heappop(hq); print(i+1); m -= 1 if m==0: break heappush(hq,(Fraction(-a[i],b[j+1]),i,j+1))