#include using namespace std; using ll = long long; int main(){ int n, x; cin >> n >> x; vector a(n), b(n); for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; vector c(x); for (int i = 0; i < n; i++) { a[i]--; c[a[i]] = b[i]; } for (int i = 0; i < x - 1; i++) { c[i + 1] = max(c[i + 1], c[i] - 1); } for (int i = x - 1; i > 0; i--) { c[i - 1] = max(c[i - 1], c[i] - 1); } for (int i = 0; i < x; i++) { cout << c[i] << " \n"[i == x - 1]; } return 0; }