#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
struct nod {
  int v, id;
} b[MAXN];
int a[MAXN];
int c[MAXN];
int cmp(nod a, nod b) { return a.v < b.v; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i].v);
    b[i].id = i;
  }
  sort(a, a + n);
  sort(b, b + m, cmp);
  int cnt = 0;
  for (int i = 0; i < m; i++) {
    while (a[cnt] <= b[i].v && cnt < n) cnt++;
    c[b[i].id] = cnt;
  }
  for (int i = 0; i < m; i++) {
    printf("%d ", c[i]);
  }
}
