import java.util.Scanner; public class HelloWorld { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b =sc.nextInt(); int c =sc.nextInt(); int d =sc.nextInt(); int p =sc.nextInt(); int q =sc.nextInt(); sc.close(); int x1 = (int)((-b + Math.sqrt(b * b - 3 * a * c))/3/a ); int x2 = (int)((-b - Math.sqrt(b * b - 3 * a * c))/3/a); System.out.println(x1 + " " + x2); int start = a*p*p*p + b*p*p + c*p + d; int end = a*q*q*q + b*q*q + c*q + d; int y1 = a*x1*x1*x1 + b*x1*x1 + c*x1 + d; int y2 = a*x2*x2*x2 + b*x2*x2 + c*x2 + d; System.out.println(y1 + " " + y2); int max = start > end ? start : end; int max_x = start > end ? p : q; int min = start > end? end : start; int min_x =start > end ? q : p; if (x1 > p && x1 < q) { max = max > y1 ? max : y1; min = y1 > min ? min : y1; max_x = max > y1 ? max_x : x1; min_x = y1 > min ? min_x : x1; } if (x2 > p && x2 < q) { max = max > y2 ? max : y2; min = y2 > min ? min : y2; max_x = max > y2 ? max_x : x2; min_x = y2 > min ? min_x : x2; } System.out.println(max + " " + max_x + " " + min + " " + min_x); } }