#include <bits/stdc++.h>
using namespace std;
long long int a[1000000], s, q, r, b[1000000], l, d, c, x, n, m, k, p, j, i, t;
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (j = 0; j < k; j++) cin >> b[j];
  for (j = 0; j < k; j++) {
    l = 0;
    r = n - 1;
    s = -1;
    while (l <= r) {
      m = (l + r) / 2;
      if (a[m] <= b[j]) {
        l = m + 1;
        s = m;
      } else {
        r = m - 1;
      }
    }
    s++;
    cout << s << " ";
    s = 0, l = 0, r = 0, m = 0;
  }
}
