#include using namespace std; int main(){ double X,Y; cin >> X >> Y; double a = X * (1-Y); double d = Y * (1-X) + X * (1-Y); printf("%.10lf %.10lf\n",min({a,d}),max({a,d})); }