#include using namespace std; int main() { int i; int N; int M; long long B; cin >> N; cin >> M; vector A( N ); pair::iterator, vector::iterator> it; for( i = 0; i < N; i++ ) cin >> A[ i ]; sort( A.begin(), A.end() ); for( i = 0; i < M; i++ ) { cin >> B; it = equal_range( A.begin(), A.end(), B ); cout << (int)( it.second - it.first ); if( i == M - 1 ) cout << endl; else cout << " "; } return 0; }