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