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