import java.io.BufferedReader; import java.io.InputStreamReader; /* Максимум четырех чисел */ 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 max = 0; if (a >= b && a >= c && a >= d) max = a; if (b >= a && b >= c && b >= d) max = b; if (c >= a && c >= b && c >= d) max = c; if (d >= a && d >= b && b >= c) max = d; if (a == b && a == c && a == d) max = a & b & c & d; System.out.println(max); } }