a,b,c,d,p,q=gets.split.map &:to_i g=h=9**9 e=f=-g (p..q).map{|x|y=((a*x+b)*x+c)*x+d;ey&&(g=y;h=x)} print e,' ',f,' ',g,' ',h