#include <bits/stdc++.h>
using namespace std;
int a[200005], b[200005];
int main() {
  int n, m, i;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (i = 0; i < m; i++) cin >> b[i];
  for (i = 0; i < m; i++) {
    if (i != m - 1)
      cout << upper_bound(a, a + n, b[i]) - a << " ";
    else
      cout << upper_bound(a, a + n, b[i]) - a << endl;
  }
  return 0;
}
