#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<pair<int, int> > b(m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    cin >> b[i].first;
    b[i].second = i;
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  int cura = 0;
  vector<int> sol(m);
  for (int i = 0; i < m; i++) {
    while (cura < n && a[cura] <= b[i].first) cura++;
    sol[b[i].second] = cura;
  }
  for (int i = 0; i < m; i++) cout << sol[i] << " ";
  return 0;
}
