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