local n, x = io.read("*n", "*n") local a, b = {}, {} for i = 1, n do a[i], b[i] = io.read("*n", "*n") end local t = {} for i = 1, x do local cand = 0 for j = 1, n do cand = math.max(cand, b[j] - math.abs(i - a[j])) end t[i] = cand end print(table.concat(t, " "))