#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { long long a, b, c, d, p, q; cin >> a >> b >> c >> d >> p >> q; long long ma = -1000000000000007, mi = 1000000000000007; long long ca, ci; for (long long i = p; i <= q; i++) { long long ans = a * i * i * i + b * i * i + c * i + d; if (ma < ans) { ma = ans; ca = i; } if (mi > ans) { mi = ans; ci = i; } } cout << ma << " " << ca << " " << mi << " " << ci << endl; return 0; }