import sys,random from itertools import permutations from collections import deque from heapq import * input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) N,M = mi() A = li() B = li() A_val = [a for a in A] A_val.sort() def cond(x): res = 0 lower = 0 for b in B: while lower!=N and A_val[lower] < x * b: lower += 1 res += N - lower return res >= M ok = 0 ng = 10**9+1 for _ in range(60): mid = (ok+ng)/2 if cond(mid): ok = mid else: ng = mid select = [] idx = [0 for i in range(M)] t = 10**18 pq = [(-A[i]*t/B[0],i) for i in range(N)] heapify(pq) while len(select) < M: val,i = heappop(pq) select.append((i,idx[i])) idx[i] += 1 if idx[i] < M: val = -A[i]*t/B[idx[i]] heappush(pq,(val,i)) for i,j in select: print(i+1)