x,y = map(float,input().split()) y = 1-y print(max(0.0,min(x,y,x+y-1)),min(x,y))