#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ double x,y; scanf("%lf%lf",&x,&y); double a=min(x,1-y); double b=x-min(x,y); printf("%lf %lf\n",max(a,b),min(a,b)); return 0; }