#include int a, b, x, y; int main() { std::cin >> a >> b >> x >> y; int path1; int path2; int path3; int ans; path1 = std::abs(a - b); path2 = std::abs(a - x) + std::abs(y - b); path3 = std::abs(a - y) + std::abs(x - b); ans = path1; if (path2 < ans) { ans = path2; } if (path3 < ans) { ans = path3; } std::cout << ans << std::endl; }