//In the name of ALLAH
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef long double ld;
int const N = 2e5 + 20;
int n, m, a[N], b[N];
vector <int> v;
map <int, int> mp;
int main(){
ios::sync_with_stdio(false); cin.tie(0);
cin >> n >> m;
for (int i = 0 ; i < n ; i ++) cin >> a[i];
for (int i = 0 ; i < m ; i ++) cin >> b[i], v.push_back(b[i]);
sort(v.begin(), v.end());
sort(a, a + n);
for (int i = 0 ; i < v.size() ; i ++){
int x = upper_bound(a, a + n, v[i]) - a;
mp[v[i]] = x;
}
for (int i = 0 ; i < m ; i ++) cout << mp[b[i]] << ' ';
return 0;
}
Ly9JbiB0aGUgbmFtZSBvZiBBTExBSAojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnR5cGVkZWYgcGFpcjxpbnQsIGludD4gcGlpOwp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKdHlwZWRlZiBwYWlyPGxsLCBsbD4gcGxsOwp0eXBlZGVmIGxvbmcgZG91YmxlIGxkOwoKaW50IGNvbnN0IE4gPSAyZTUgKyAyMDsKaW50IG4sIG0sIGFbTl0sIGJbTl07CnZlY3RvciA8aW50PiB2OwptYXAgPGludCwgaW50PiBtcDsKCmludCBtYWluKCl7CiAgICBpb3M6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7IGNpbi50aWUoMCk7CiAgICBjaW4gPj4gbiA+PiBtOwogICAgZm9yIChpbnQgaSA9IDAgOyBpIDwgbiA7IGkgKyspIGNpbiA+PiBhW2ldOwogICAgZm9yIChpbnQgaSA9IDAgOyBpIDwgbSA7IGkgKyspIGNpbiA+PiBiW2ldLCB2LnB1c2hfYmFjayhiW2ldKTsKICAgIHNvcnQodi5iZWdpbigpLCB2LmVuZCgpKTsKICAgIHNvcnQoYSwgYSArIG4pOwogICAgZm9yIChpbnQgaSA9IDAgOyBpIDwgdi5zaXplKCkgOyBpICsrKXsKICAgICAgICBpbnQgeCA9IHVwcGVyX2JvdW5kKGEsIGEgKyBuLCB2W2ldKSAtIGE7CiAgICAgICAgbXBbdltpXV0gPSB4OwogICAgfQogICAgZm9yIChpbnQgaSA9IDAgOyBpIDwgbSA7IGkgKyspIGNvdXQgPDwgbXBbYltpXV0gPDwgJyAnOwogICAgcmV0dXJuIDA7Cn0=