#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<int> b(m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a.begin(), a.end());
  for (int i = 0; i < m; i++) {
    int x = b[i];
    int f = 0, l = n - 1;
    while (true) {
      if (l == f) {
        if (a[l] <= x) {
          cout << l + 1 << " ";
        } else {
          cout << l << " ";
        }
        break;
      }
      if (l == f + 1) {
        if (a[l] <= x) {
          cout << l + 1 << " ";
          break;
        }
        if (a[f] <= x) {
          cout << l << " ";
          break;
        }
        cout << f << " ";
        break;
      }
      if (a[(l + f) / 2] <= x) {
        f = (l + f) / 2;
      }
      if (a[(l + f) / 2] > x) {
        l = (l + f) / 2;
      }
    }
  }
}
