import std, core.bitop; string[] _R; void readM(T)(ref T x) { while (_R.empty) { _R = readln.chomp.split; } x = _R.front.to!T; _R.popFront; } bool chmin(T)(ref T A, T B) { if (A > B) { A = B; return true; } else { return false; } } bool chmax(T)(ref T A, T B) { if (A < B) { A = B; return true; } else { return false; } } int lowerBound(T)(T[] A, T x) { int lo = -1, hi = cast(int)(A.length); while (hi - lo > 1) { int mid = lo + hi >> 1; (A[mid] < x ? lo : hi) = mid; } return hi; } int upperBound(T)(T[] A, T x) { int lo = -1, hi = cast(int)(A.length); while (hi - lo > 1) { int mid = lo + hi >> 1; (A[mid] > x ? hi : lo) = mid; } return hi; } void main() { int N, X; N.readM; X.readM; auto A = new int[N]; auto B = new int[N]; foreach (i; 0 .. N) { A[i].readM; B[i].readM; } auto ans = new int[X + 1]; foreach (i; 0 .. N) { foreach (j; 0 .. B[i]) { int na0 = A[i] - j; int na1 = A[i] + j; if (na0 >= 0) chmax(ans[na0], B[i] - j); if (na1 <= X) chmax(ans[na1], B[i] - j); } } ans.popFront; writefln("%(%s %)", ans); }