#include <bits/stdc++.h>
using namespace std;
int n, m, j;
long long a[200002];
long long b[200002];
int main() {
  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);
  long long val = b[0];
  int lower = 0;
  int upper = n;
  while (lower != upper) {
    int mid = (lower + upper) / 2;
    if (a[mid] <= val) {
      lower = mid + 1;
    } else {
      upper = mid;
    }
  }
  cout << lower;
  for (int i = 1; i < m; i++) {
    val = b[i];
    lower = 0;
    upper = n;
    while (lower != upper) {
      int mid = (lower + upper) / 2;
      if (a[mid] <= val) {
        lower = mid + 1;
      } else {
        upper = mid;
      }
    }
    cout << ' ' << lower;
  }
  return 0;
}
