class heap: #comp:比較関数 小さいものから順に取り出す def __init__(s, comp = lambda x:x): s.comp = comp s.values = [] #index と 子供たちの位置関係を調整 def adjust(s, index): next = None cur = s.comp(s.values[index]) for i in range(index * 2 + 1, min(index * 2 + 3, len(s.values))): if cur > s.comp(s.values[i]): next = i cur = s.comp(s.values[i]) if next != None: s.values[index], s.values[next] = s.values[next], s.values[index] return next else: return None def push(s, value): s.values.append(value) index = (len(s.values) - 2) // 2 while index >= 0: s.adjust(index) index = (index - 1) // 2 def pop(s): if len(s.values) == 0: return None if len(s.values) == 1: return s.values.pop() ret = s.values[0] s.values[0] = s.values.pop() index = 0 while index != None: index = s.adjust(index) return ret N, M = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) number = [0 for i in range(N)] H = heap() for i in range(N): H.push((-(A[i] / B[0]), i)) for i in range(M): cur = H.pop() number[cur[1]] += 1 print(cur[1] + 1) H.push((-(A[cur[1]] / B[number[cur[1]]]), cur[1]))