#include <bits/stdc++.h>
using namespace std;
const int mod = 1000007;
const int high = 200003;
long long ar[high];
long long khoj(long long lo, long long hi, long long itm) {
  long long mid;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (ar[mid] == itm)
      return mid;
    else if (ar[mid] > itm)
      hi = mid - 1;
    else if (ar[mid] < itm)
      lo = mid + 1;
  }
  return lo;
}
int main() {
  ios_base::sync_with_stdio(false);
  map<long long, long long> mp;
  long long n, m, i, x;
  while (cin >> n >> m) {
    mp.clear();
    for (i = 0; i < n; i++) {
      cin >> ar[i];
    }
    sort(ar, ar + n);
    for (i = 0; i < n; i++) mp[ar[i]] = i + 1;
    for (i = 0; i < m; i++) {
      cin >> x;
      int ret = khoj(0, n - 1, x);
      if (ar[ret] == x)
        cout << mp[x] << " ";
      else
        cout << ret << " ";
    }
    cout << "\n";
  }
  return 0;
}
