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[1]==B[1]){ if(Math.Abs(B[0])>Math.Abs(A[0])){ Console.WriteLine(A[0]); }else{ Console.WriteLine(A[0]); } return; } if(A[0]==B[0]){ if(Math.Abs(B[1])>Math.Abs(A[1])){ Console.WriteLine(A[1]); }else{ Console.WriteLine(A[1]); } return; } if(A[0]==A[1]&&B[0]==B[1]){ if(Math.Abs(B[1])>Math.Abs(A[1])){ Console.WriteLine(A[1]); }else{ Console.WriteLine(A[1]+2); } return; } Console.WriteLine(A.Max()); return; } 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));} }