not satisfying the third requirement

package com.codegym.task.task04.task0441;
/*
Somehow average
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader bon = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(bon.readLine());
int b = Integer.parseInt(bon.readLine());
int c = Integer.parseInt(bon.readLine());
int middle = 0;
if((a>b) && (a<c))
{
middle = a;
}
else
if((b>a) && (b<c))
{
middle = b;
}
else
if((c>a) && (c<b))
{
middle = c;
}
else
if((a>b) && (b>c) && (c>a))
{
middle = b;
}
else
if((a<b) && (b<c) && (c<a))
{
middle = c;
}
else
if((a==b) || (a==c))
{
middle = a;
}
else
if((b==a) || (b==c))
{
middle = b;
}
else
if((c==a) || (c==b)){
middle = c;
}
else
{
middle = a;
}
System.out.println(middle);//write your code here
}
}