from heapq import heappop, heappush class T(object): def __init__(self, bunsi, bunbo, idx): self.bunsi = bunsi self.bunbo = bunbo self.idx = idx def __lt__(self, other): if other.bunbo * self.bunsi == self.bunbo * other.bunsi: return other.idx > self.idx else: return other.bunbo * self.bunsi > self.bunbo * other.bunsi n, m = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) H = [] for i in range(n): heappush(H, T(A[i], B[0], i)) C = [0 for _ in range(n)] for _ in range(m): t = heappop(H) idx = t.idx print(idx + 1) C[idx] += 1 if C[idx] == m: continue heappush(H, T(A[idx], B[C[idx]], idx))