var a,b,c,d:integer;
begin
write('a = ');
readln(a);
write('b = ');
readln(b);
write('c = ');
readln(c);
write('d = ');
readln(d);
writeln('X = ',(a*a+b*b)-c+d);
if (a*a+b*b)-c+d>0 then writeln(a,' + ',b,' = ',a+b)
else writeln(c,' + ',d,' = ',c+d)
end.