#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<int> b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  sort(a.begin(), a.end());
  std::vector<int>::iterator upper;
  for (int i = 0; i < m; i++) {
    upper = upper_bound(a.begin(), a.end(), b[i]);
    cout << (upper - a.begin()) << " ";
  }
  cout << endl;
}
