#include <bits/stdc++.h>
using namespace std;
int N, M;
const int maxN = 1e9;
int main() {
  cin >> N >> M;
  vector<int> A(N), B(M);
  for (auto &x : A) cin >> x;
  for (auto &x : B) cin >> x;
  sort(A.begin(), A.end());
  for (int j = 0; j < M; j++) {
    auto it = upper_bound(A.begin(), A.end(), B[j]);
    int idx = it - A.begin();
    cout << idx << " ";
  }
  return 0;
}
