a,b=map(float,input().split()) b=1-b print(min(a,b),max(0,a+b-1))