public class Solution { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int max = scanner.hasNextInt() ? scanner.nextInt(): Integer.MIN_VALUE; while(scanner.hasNextInt()){ int m = scanner.nextInt(); if(m>max&&(m%2)==0)max=m; } int total = max%2==0?max : Integer.MIN_VALUE; System.out.println(total); } }