#include <bits/stdc++.h>
using namespace std;
int a[200005];
int b[200005];
int main() {
  int n, m;
  int i, j;
  while (~scanf("%d%d", &n, &m)) {
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    for (i = 0; i < m; i++) scanf("%d", &b[i]);
    sort(a, a + n);
    for (i = 0; i < m; i++) {
      if (i != m - 1)
        printf("%d ", upper_bound(a, a + n, b[i]) - a);
      else
        printf("%d\n", upper_bound(a, a + n, b[i]) - a);
    }
  }
  return 0;
}
