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