import numpy as np i = input() i_list = i.split() i_intlist = [int(s) for s in i_list] #print(i_intlist) a = i_intlist[0] b = i_intlist[1] c = i_intlist[2] d = i_intlist[3] p = i_intlist[4] q = i_intlist[5] #print(a) #print(b) #print(c) #print(d) #print(p) #print(q) lists = [] lists_f = [] lists_answer = [] for x in range(p, q+1): f = a*x**3 + b*x**2 + c*x + d lists.append(x) lists_f.append(f) max_value = max(lists_f) max_index = lists_f.index(max_value) min_value = min(lists_f) min_index = lists_f.index(min_value) #print(max_value) #print(lists[max_index]) #print(min_value) #print(lists[min_index]) lists_answer.append(max_value) lists_answer.append(lists[max_index]) lists_answer.append(min_value) lists_answer.append(lists[min_index]) lists_answer_str = [str(n) for n in lists_answer] #print(lists_answer_str) StrA = " ".join(lists_answer_str) print(StrA)