from math import sqrt
from sys import stdin
fst = stdin.readline().strip()
f = eval(fst)
lb = float(stdin.readline().strip())
ub = float(stdin.readline().strip())
print(fst, lb, ub)
fnew = restrict_range(f, lb, ub)
for line in stdin:
    if line.startswith("==="):
        fst = stdin.readline().strip()
        f = eval(fst)
        lb = float(stdin.readline().strip())
        ub = float(stdin.readline().strip())
        print(fst, lb, ub)
        fnew = restrict_range(f, lb, ub)
    else:
        print(line.strip(), fnew(float(line.strip())))