#include<iostream>
#include<cstdio>
#include<cassert>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<vector> 
#include<cstring>
#include<string>
#include<map>
#include<set>

#define mp make_pair
#define scn second
#define frs first
#define pb push_back

#define NAME "ant"

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, int> pi;
const int P = 239017;
const ll INF = 1000000000ll * 1000000000;
const int MAX = 2000 + 10;
int n, m;
int chair[100000];
int p[100000];
int ans[100000];

int main() {
    freopen(NAME ".in", "r", stdin); 
    freopen(NAME ".out", "w", stdout); 
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++i)
      scanf("%d", &p[i]);
    for (int i = 0; i < m; ++i)
      scanf("%d", &chair[i]);
    int used[100000];
    memset(used, 0, 100000 * sizeof(int));
    memset(ans, -1, 100000 * sizeof(int));
    for (int i = 0; i < m; ++i) {
        int now = -1;
        for (int j = 0; j < n; ++j) {
            if (p[j] > chair[i])
                break;
            if (!used[j])
                now = j;
        }
        if (now != -1)
            ans[now] = i, used[now] = 1;
    }
    
    
    for (int i = 0; i < n; ++i)
      printf ("%d\n", ans[i]==-1?-1:ans[i] + 1);
    return 0;
}




