#include //全てのヘッダファイルをインクルード //ループ #define rep(i, n) for(int i = 0; i < (n); i++) //普通のループ #define repr(i, n) for(int i = n; i >= 0; i--) //逆ループ //型名省略 typedef long long ll; //値 static const ll MX = 100005; static const ll MX_ll = 1e18; //ソート #define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0])) using namespace std; //#include "./lib/generic/search.h" int main(){ ll n, d; cin >> n >> d; ll a[n], amax=0; rep(i, n){ cin >> a[i]; amax = max(amax, a[i]); } ll b[amax], ans[amax]; //std::sort(a, a + SIZE_OF_ARRAY(a)); //rep(i, n) cout << a[i] << " "; rep(i, n){ b[i] = 0; ans[i] = 0; } ll cnt = 0; rep(i, n){ cnt = 0; if(b[a[i]]==1){ cout << ans[a[i]] << endl; } else{ rep(j, n){ //if(a[i]=d) cnt++; } b[a[i]] = 1; ans[a[i]] = cnt; cout << cnt << endl; } } return 0; }