#include <bits/stdc++.h>
using namespace std;
struct sth {
  int num, w, v;
};
sth a[200001];
sth b[200001];
int n, m, i, l, r, mid, ans;
bool comp(sth x, sth y) { return x.num < y.num; }
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].num);
    a[i].w = i;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &b[i].num);
    b[i].w = 0;
  }
  sort(a + 1, a + n + 1, comp);
  for (i = 1; i <= m; i++) {
    l = 1;
    r = n;
    ans = 0;
    while (l <= r) {
      mid = (l + r) / 2;
      if (b[i].num >= a[mid].num) {
        l = mid + 1;
        ans = mid;
      } else
        r = mid - 1;
    }
    b[i].w = ans;
  }
  for (i = 1; i <= m; i++) {
    printf("%d", b[i].w);
    if (i < m) printf(" ");
  }
  return 0;
}
