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