No matter how I twist this task am still stuck. Have tried more than a dozens of inputs(even negative numbers) which gave me the correct output, but codegym says "NO". Please for help
package com.codegym.task.task04.task0441;
/*
Somehow average
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in) );
String num = reader.readLine();
String num1 = reader.readLine();
String num2 = reader.readLine();
// enter three numbers
int a = Integer.parseInt(num);
int b = Integer.parseInt(num1);
int c = Integer.parseInt(num2);
//If all the numbers are equal, display any one of them.
if(a == b && b == c) System.out.println(b);
else
{
//If two of the three numbers are equal, display either of the two
if (b == c) System.out.println(b);
else if(a == b) System.out.println(a);
else if(a == c) System.out.println(c);
else
{
//middle number of the three numbers.
if(a > b)
if(b > c) System.out.println(b);
else System.out.println(c);
else if(b > c)
if(a > c) System.out.println(a);
else System.out.println(c);
else
if(b > a) System.out.println(b);
else System.out.println(c);
}
}
}
}