#include using namespace std; using ll = long long; using ld = long double; template using vc = vector; template using vvc = vc>; void solve(); int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); ll t = 1; // cin >> t; for (int i = 1; i <= t; i++) solve(); return 0; } void solve() { ll n, x; cin >> n >> x; vc res(x + 1); for (int i = 0; i < n; i++) { ll a, b; cin >> a >> b; for (int i = 1; i <= x; i++) res[i] = max(res[i], b - abs(i - a)); } for (int i = 1; i <= x; i++) cout << res[i] << " \n"[i == x]; }