#include <bits/stdc++.h>
const int MAXN = 222222;
int n, m, a[MAXN], b[MAXN];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  std::sort(a + 1, a + n + 1);
  for (int i = 1; i <= m; i++) {
    scanf("%d", b + i);
    printf("%d%c", std::upper_bound(a + 1, a + n + 1, b[i]) - a - 1,
           " \n"[i == m]);
  }
  return 0;
}
