#include <bits/stdc++.h>
using namespace std;
int binary_search(int arr[], int l, int h, int x) {
  while (l <= h) {
    int mid = (l + h) / 2;
    if (arr[mid] <= x)
      l = mid + 1;
    else
      h = mid - 1;
  }
  return h;
}
void countEleLessThanOrEqual(int arr1[], int arr2[], int m, int n) {
  sort(arr1, arr1 + m);
  for (int i = 0; i < n; i++) {
    int index = binary_search(arr1, 0, m - 1, arr2[i]);
    cout << (index + 1) << " ";
  }
}
int main() {
  int m, n;
  cin >> m >> n;
  int arr1[m], arr2[n];
  for (int i = 0; i < m; i++) cin >> arr1[i];
  for (int i = 0; i < n; i++) cin >> arr2[i];
  countEleLessThanOrEqual(arr1, arr2, m, n);
  return 0;
}
