#include <bits/stdc++.h>
long long int mod = 1000000007;
using namespace std;
int n, m;
long long int a[200000], b[200000];
int bin_search(long long int x) {
  int l = 0, r = n - 1;
  int mid;
  while (l <= r) {
    mid = l + (r - l) / 2;
    if (a[mid] <= x)
      l = mid + 1;
    else if (a[mid] > x && a[mid - 1] <= x)
      return mid;
    else if (a[mid] > x)
      r = mid - 1;
  }
  if (mid == 0) {
    if (a[0] <= x)
      return 1;
    else
      return 0;
  }
  return mid + 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  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);
  for (int i = 0; i < m; i++) cout << bin_search(b[i]) << " ";
  return 0;
}
