#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 50100;
struct People
{
int w, id;
bool operator < (const People& a) const
{
if(w == a.w) return id < a.id;
return w > a.w;
}
}A[maxn];
int n, k, E[11];
int main()
{
cin >> n >> k;
for(int i = 1; i <= 10; i++) cin >> E[i];
for(int i = 1; i <= n; i++)
{
cin >> A[i].w;
A[i].id = i;
}
sort(A+1, A+n+1);
for(int i = 1; i <= n; i++)
A[i].w += E[(i - 1) % 10 + 1];
sort(A+1, A+n+1);
for(int i = 1; i <= k; i++)
cout << A[i].id << (i == k ? '\n' : ' ');
return 0;
}