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