a, b = map(float, input().split()) b = 1 - b print('{:.20f} {:.20f}'.format(min(a, b), max(0, a + b - 1)))