a,b,c,d,p,q=map(int,input().split()) def f(x): return a*(x**3)+b*(x**2)+c*x+d y=[f(x) for x in range(p,q+1)] m=min(y) M=max(y) mv=Mv=-1 for x in range(p,q+1): if mv==-1 and f(x)==m: mv=x if Mv==-1 and f(x)==M: Mv=x print(M,Mv,m,mv)