#include <bits/stdc++.h>
using namespace std;
long long factorial(long long n) {
  long long k = n;
  long long fact = 1;
  if (n == 0) {
    return 1;
  }
  while (k >= 1) {
    fact *= k;
    k--;
  }
  return fact;
}
bool isPrime(long long n) {
  if (n == 1) return true;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
struct comp {
  bool operator()(pair<long long, long long>& a,
                  pair<long long, long long>& b) {
    if (a.second == b.second) return a.first < b.first;
    return a.second > b.second;
  }
};
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> ar(n), br(m);
  for (long long i = 0; i < n; i++) cin >> ar[i];
  for (long long i = 0; i < m; i++) cin >> br[i];
  sort(ar.begin(), ar.end());
  for (long long i = 0; i < m; i++) {
    auto it = upper_bound(ar.begin(), ar.end(), br[i]);
    long long indx = it - ar.begin();
    cout << indx << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
