#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, a[200001], b[200001], x;
  cin >> n >> m;
  long long int i, j;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (i = 0; i < m; i++) {
    cin >> b[i];
    x = lower_bound(a, a + n, b[i]) - a;
    if (a[x] == b[i]) {
      cout << upper_bound(a, a + n, b[i]) - a << " ";
    } else {
      cout << x << " ";
    }
  }
}
