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