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