#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() int main() { cin.tie(nullptr); int N, M; cin >> N >> M; vector A(N), B(M); rep(i, 0, N) cin >> A[i]; rep(i, 0, M) cin >> B[i]; sort(all(A)); rep(i, 0, M) { int l = lower_bound(all(A), B[i]) - A.begin(); int r = upper_bound(all(A), B[i]) - A.begin(); cout << r - l; if (i == M - 1) cout << '\n'; else cout << ' '; } }