X,Y=list(map(float,input().split())) A=min(X,1-Y) B=X-min(X,Y) print(A,B)