#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
signed main(void) {
  ios::sync_with_stdio(false);
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(10);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> l(n), r(n);
  for (long long i = (0); i < (n); ++i) {
    cin >> l[i] >> r[i];
  }
  vector<long long> ans(m + 1, 0);
  while (m > 0) {
    vector<long long> p(m + 2, 0);
    for (long long i = (0); i < (n); ++i) {
      p[l[i]]++;
      p[r[i] + 1]--;
    }
    for (long long i = (1); i < (m + 2); ++i) {
      p[i] += p[i - 1];
    }
    for (long long i = ((m + 1) / 2); i < (m + 1); ++i) {
      ans[i] = p[i];
    }
    m /= 2;
    for (long long i = (0); i < (n); ++i) {
      if (l[i] > m) {
        l[i] /= 2;
        r[i] /= 2;
      }
    }
  }
  for (long long i = (0); i < (n); ++i) {
    cout << ans[i] << endl;
  }
  return 0;
}
