import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int X = sc.nextInt(); int[] A = new int[N]; int[] B = new int[N]; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); B[i] = sc.nextInt(); } for (int x = 1; x <= X; x++) { int maxVal = 0; for (int i = 0; i < N; i++) { maxVal = Math.max(B[i] - Math.abs(x - A[i]), maxVal); } System.out.print(maxVal + " "); } } }