import java.util.*; class A{ static Scanner s = new Scanner(System.in); static boolean b[]; public static void main(String[] args) { Blocks[] blocks = new Blocks[s.nextInt()]; int m=s.nextInt(); b = new boolean[m]; for (int i=0; i> T max(T t1, T t2){ if(t1.compareTo(t2)>=0) return t1; else return t2; } static > T min(T t1, T t2){ if(t1.compareTo(t2)<=0) return t1; else return t2; } } class Blocks implements Comparable{ int length,pl,pr; Blocks(int m, int pl, int pr) { this.length = m; this.pl = pl; this.pr = pr; } boolean isPainted(int i) { return (i>=this.pl)&&(i<=this.pr); } @Override public int compareTo(Blocks o) { for(int i=0; i