#include <bits/stdc++.h>   using namespace std;   const int maxn = 5e5 + 10;   pair<long long, long long> p[maxn];   long long ans[maxn];   int main() {     int n, num = 0, cnt = 0;     long long l, r;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %lld%lld , &l, &r);       p[++num].first = l;       p[num].second = 1;       p[++num].first = r + 1;       p[num].second = -1;     }     sort(p + 1, p + 1 + num);     for (int i = 1; i <= num; i++) {       ans[cnt] += p[i].first - p[i - 1].first;       cnt += p[i].second;     }     for (int i = 1; i <= n; i++) printf( %lld%c , ans[i], i == n ?   n  :    );     return 0;   }   