using System; using System.Collections; using System.Collections.Generic; using System.Linq; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ if(!(A[0]==A[1]||A[0]==-A[1])){ Console.WriteLine(A.Select(x=>Math.Abs(x)).Max()); return; } if(!(B[0]==B[1]||B[0]==-B[1])){ Console.WriteLine(A.Select(x=>Math.Abs(x)).Max()); return; } if(A[0]*B[0]<0){ Console.WriteLine(A.Select(x=>Math.Abs(x)).Max()); return; } if(A[0]+A[1]!=B[0]+B[1]&&A[0]-A[1]!=B[0]-B[1]){ Console.WriteLine(A.Select(x=>Math.Abs(x)).Max()); return; } if(Math.Abs(A[0])>Math.Abs(B[0])){ Console.WriteLine(Math.Abs(A[0])+2); return; } Console.WriteLine(A.Select(x=>Math.Abs(x)).Max()); } long[] A,B; public Sol(){ A=rla();B=rla(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(){return Console.ReadLine().Split(' ');} static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }