package com.javarush.task.task04.task0419; 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()); if (a > b && a > c && a > d){ System.out.println(a); }else if (b > a && b > c && b > d){ System.out.println(b); }else if (c > b && c > a && c > d){ System.out.println(c); }else if (d > b && d > a && d > c){ System.out.println(d); }else if (a == b || b == c || c == d || a == c || a == d || b == d ){ System.out.println(a | b | c | d); } } }