x, y = map(float, input().split()) max_prob = min(x, 1.0 - y) min_prob = max(0.0, x - y) print("{0:.11f} {1:.11f}".format(max_prob, min_prob))