n,m=map(int,input().split()) a=list(map(int,input().split())) p=list(map(int,input().split())) dp = [[] for _ in range(m + 1)] for i in range(n): if len(dp[a[i]])==0: dp[a[i]].append(i+1) def cmp(a,b): l=min(len(a),len(b)) for i in range(l): if p[a[i]-1]!=p[b[i]-1]: return p[a[i]-1]
len(b) for i in range(n): for j in range(m): if len(dp[j])>0 and j+a[i]<=m and dp[j][-1]0: print(len(dp[m]), *dp[m],sep='\n') else: print(-1)