from heapq import * n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) d = [1] * n h = [(-x / b[0], i) for i, x in enumerate(a)] heapify(h) while m: _, k = heappop(h) print(k + 1) m -= 1 j = d[k] d[k] = j + 1 if j < len(b): heappush(h, (-a[k] / b[j], k))