import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No0186 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { boolean[][] f = new boolean[3][3000001]; for (int i=0; i<3; i++) { int x = in.nextInt(); int y = in.nextInt(); for (int j=x; j