#include using namespace std; #define INF 100000000 #define YJ 1145141919 #define INF_INT_MAX 2147483647 #define INF_LL_MAX 9223372036854775807 #define EPS 1e-10 #define Pi acos(-1) #define LL long long #define ULL unsigned long long #define LD long double const int MAX_N = 100005; const int MAX_M = 100005; int N, M; LL A[MAX_N], B[MAX_M]; map m; int main() { cin >> N >> M; for(unsigned int index = 0; index < N; index++) { cin >> A[index]; m[A[index]]++; } for(unsigned int index = 0; index < M; index++) { cin >> B[index]; } for(unsigned int index = 0; index < M; index++) { cout << m[B[index]]; if(index < M-1) { cout << " "; } } cout << endl; return 0; }