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