#include <bits/stdc++.h>
using namespace std;
long long FP(long long a, long long x) {
  if (x == 0) return 1;
  if (x == 1) return a;
  long long ans = FP(a, x / 2);
  ans = ans * ans;
  if (x % 2 != 0) ans = ans * a;
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n, m, a[200005], b[200005];
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  int l, r, mid;
  for (int i = 0; i < m; i++) {
    int mx = -1;
    l = 0, r = n - 1;
    while (l <= r) {
      mid = l + (r - l) / 2;
      if (a[mid] <= b[i]) {
        mx = max(mx, mid);
        l = mid + 1;
      } else
        r = mid - 1;
    }
    cout << mx + 1 << " ";
  }
  return 0;
}
