#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 10;
int a[N];
int ans;
int main() {
  int q, x;
  cin >> q >> x;
  while (q--) {
    int n;
    cin >> n;
    a[n % x]++;
    while (a[n % x]) {
      ans++;
      a[n % x]--;
    }
    cout << ans << endl;
  }
  return 0;
}
