#include <bits/stdc++.h>
using namespace std;
int helper(int b, int *a, int low, int high) {
  if (*(a + low) > b) return low;
  if (*(a + high) <= b) return high + 1;
  int mid = (high - low) / 2 + low;
  if (*(a + mid) <= b) {
    if (*(a + mid + 1) <= b) {
      return helper(b, a, mid + 1, high);
    } else {
      return mid + 1;
    }
  } else {
    if (*(a + mid - 1) <= b) {
      return mid;
    } else {
      return helper(b, a, low, mid);
    }
  }
}
int biSer(int b, int *a, int *n, unordered_map<int, int> &mapa) {
  int ans = helper(b, a, 0, *n - 1);
  mapa[b] = ans;
  return ans;
}
void priAr(int *arr, int n) {
  for (int i = 0; i < n; i++) {
    cout << *(arr + i) << endl;
  }
}
int main() {
  int n, m, *a, *b, i;
  unordered_map<int, int> mapa;
  cin >> n >> m;
  a = new int[n];
  b = new int[m];
  for (i = 0; i < n; i++) {
    cin >> *(a + i);
  }
  for (i = 0; i < m; i++) {
    cin >> *(b + i);
  }
  sort(a, a + n);
  for (i = 0; i < m; i++) {
    if (mapa.find(*(b + i)) != mapa.end()) {
      cout << mapa[*(b + i)] << " ";
      continue;
    }
    cout << biSer(*(b + i), a, &n, mapa) << " ";
  }
  return 0;
}
