#include <bits/stdc++.h>
const int maxn = 2e6 + 10;
const int maxval = 1e9 + 10;
using namespace std;
int n, m, a[maxn], b[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  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++) {
    if (a[0] > b[i]) {
      cout << 0 << " ";
      continue;
    }
    int Start = 0, End = n - 1, Middle;
    while (Start <= End) {
      Middle = (Start + End) / 2;
      if (a[Middle] <= b[i]) {
        if (a[Middle + 1] <= b[i])
          Start = Middle + 1;
        else
          break;
      }
      if (a[Middle] > b[i]) End = Middle - 1;
    }
    cout << Middle + 1 << " ";
  }
}
