import java.io.*;

public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(reader.readLine());
        int b = Integer.parseInt(reader.readLine());
        int c = Integer.parseInt(reader.readLine());
        int d = Integer.parseInt(reader.readLine());
        int maxAB = 0;
        int maxCD = 0;
        if(a>b && c>d){
            maxAB = a;
            maxCD = c;
            if(maxAB>=maxCD){
                System.out.println(maxAB);
            } else {
                System.out.println(maxCD);
            }
        } else {
          if(a>b && c<d){
              maxAB = a;
              maxCD = d;
              if(maxAB>=maxCD){
                  System.out.println(maxAB);
              } else {
                  System.out.println(maxCD);
              }
          } else {
              if(ad){
                  maxAB = b;
                  maxCD = c;
                  if(maxAB>=maxCD){
                      System.out.println(maxAB);
                  } else {
                      System.out.println(maxCD);
                  }
              } else {
                  if(a=maxCD){
                          System.out.println(maxAB);
                      } else {
                          System.out.println(maxCD);
                      }
                  }
              }
          }
        }
    }
}