x,y=map(float,input().split()) f=1-y Max=min(x,f) Min=x-min(x,y) print(Max,Min)