import java.util.Scanner; public class Yuki208{ public static void main(String[] arg){ Scanner sc = new Scanner(System.in); int x,y,x1,y1; x = sc.nextInt(); y = sc.nextInt(); x1 = sc.nextInt(); y1 = sc.nextInt(); if(x == y && x1 == y1 && x1 y){ System.out.println(x); }else{ System.out.println(y); } } } }