#include using namespace std; using ll = long long; using P = pair; using T = tuple; // #include // using namespace atcoder; // using mint = modint1000000007; #define rep(i, n) for(ll i = 0; i < n; i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); ll n, x; cin >> n >> x; vector a(n), b(n), ans(x,0); rep(i,n) { cin >> a[i] >> b[i]; a[i]--; rep(j,x) ans[j] = max(ans[j], max(b[i]-abs(j-a[i]),0ll)); } rep(i,x) cout << ans[i] << " "; cout << endl; return 0; }