package com.codegym.task.task04.task0419; /* Maximum of four numbers */ import java.io.*; import java.util.Arrays; public class Solution { public static void main(String[] args) throws Exception { //write your code here BufferedReader reader = new BufferedReader( new InputStreamReader(System.in)); int w = Integer.parseInt(reader.readLine()); int x = Integer.parseInt(reader.readLine()); int y = Integer.parseInt(reader.readLine()); int z = Integer.parseInt(reader.readLine()); int[] arr = { w , x , y , z}; Arrays.sort(arr); int max = 0; for(int i = 0; i < arr.length - 1 ; i++){ if(arr[i] < arr[i+1]){ max = arr[i+1]; } } System.out.println(max); } }