#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) (signed)((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"  << " " << __FILE__ << endl;

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    int n,m;
    cin >> n >> m;
    VI l(n),r(n);
    REP(i,n){
        cin >> l[i] >> r[i];
    }

    VI ans (m+1,0);

    while (m>0){
        VI p(m+2,0);
        REP(i,n){
            p[l[i]]++;
            p[r[i]+1]--;
        }
        FOR(i,1,m+2){
            p[i] += p[i-1];
        }

        FOR(i,(m+1)/2,m+1){
            ans[i] = p[i];
        }
        m/=2;
        REP(i,n){
            if(l[i]>m){
                l[i]/=2;
                r[i]/=2;
            }
        }
    }

    REP(i,n){
        cut << ans[i] << endl;
    }

    return 0;
}
