Не выполняется последнее условие
package com.javarush.task.task04.task0419;
/*
Максимум четырех чисел
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sNum1 = reader.readLine();
String sNum2 = reader.readLine();
String sNum3 = reader.readLine();
String sNum4 = reader.readLine();
int a = Integer.parseInt(sNum1);
int b = Integer.parseInt(sNum2);
int c = Integer.parseInt(sNum3);
int d = Integer.parseInt(sNum4);
if(a==d && a>b && a>c)
System.out.println(a);
else if(b>a && b>c && b>d)
System.out.println(b);
else if(c>a && c>b && c>d)
System.out.println(c);
else if(d>a && d>b && d>c)
System.out.println(d);
}
}