#include #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef long long ll; ll a[200000]; int main(){ int n,m;scanf("%d%d",&n,&m); unordered_mapmp; rep(i,n){ ll a;scanf("%lld",&a);mp[a]++; } rep(i,m){ ll b;scanf("%lld",&b); if(i)printf(" "); printf("%d",mp[b]); } puts(""); }