import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Deque; import java.util.ArrayDeque; import java.util.Collections; public class Main { public static void main(String[] args) { FS reader = new FS(); // write reader int N = reader.nextInt(); int[][] q = new int[N][4]; boolean[] b = new boolean[N]; for(int i=0; i