#include <bits/stdc++.h>
using namespace std;
int n, a, m, ini, fin;
vector<int> arr1, arr2;
int main() {
  cin >> n >> m;
  while (n--) {
    cin >> a;
    arr1.push_back(a);
  }
  while (m--) {
    cin >> a;
    arr2.push_back(a);
  }
  sort(arr1.begin(), arr1.end());
  ini = 0;
  fin = arr1.size() - 1;
  for (int i = 0; i < arr2.size(); i++) {
    ini = 0;
    fin = arr1.size() - 1;
    while (abs(ini - fin) > 1) {
      if (arr2[i] >= arr1[(fin + 1 + ini) / 2]) {
        ini = (fin + 1 + ini) / 2;
      }
      if (arr2[i] < arr1[(fin + 1 + ini) / 2]) {
        fin = (fin + 1 + ini) / 2;
      }
    }
    if (arr2[i] < arr1[ini]) {
      cout << ini << " ";
    } else if (arr2[i] < arr1[fin]) {
      cout << ini + 1 << " ";
    } else
      cout << fin + 1 << " ";
  }
  return 0;
}
