import java.util.*; import java.io.*; class Main{ private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static final PrintWriter out = new PrintWriter(System.out); public static void main(String[] args)throws IOException{ String[] str = br.readLine().split(" "); int N = Integer.parseInt(str[0]); int X = Integer.parseInt(str[1]); int[][] AB = new int[N][2]; for(int i=0;iInteger.compare(a[0],b[0])); int[] L = new int[X+1]; for(int i=0;i0) L[AB[i][0]-j] = Math.max(L[AB[i][0]-j],AB[i][1]-j); } } out.print(L[1]); for(int i=2;i<=X;i++){ out.print(" "); out.print(L[i]); } out.println(); br.close(); out.close(); } }