What is wrong with this logic?
package com.codegym.task.task04.task0419;
/*
Maximum of four numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a=Integer.parseInt(br.readLine());
int b=Integer.parseInt(br.readLine());
int c=Integer.parseInt(br.readLine());
int d=Integer.parseInt(br.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>a)&&(c>b)&&(c>d))
System.out.println(c);
else if((d>a)&&(d>b)&&(d>c))
System.out.println(d);
else if((a==b)&(c==d)&(b>c))
System.out.println(a);
else if((a==c)&&(b==d)&&(c>b))
System.out.println(a);
else if((a==d)&&(b==c)&&(d>c))
System.out.println(a);
else if((b==c)&&(a==d)&&(c>d))
System.out.println(b);
else if((a==c)&&(b==d)&&(c<b))
System.out.println(b);
else if((a==b)&&(c==d)&&(b<c))
System.out.println(c);
else if((a==b)&&(b==c)&&(c>d))
System.out.println(c);
else if((b==c)&&(c==d)&&(c>a))
System.out.println(c);
else if((a==c)&&(c==d)&&(a>b))
System.out.println(c);
else if((a==b)&&(b==d)&&(b>c))
System.out.println(d);
else if((a==b)&&(b==c)&&(c==d))
System.out.println(a);
}
}