My head just can't help to think more that this.
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 num1 = reader.readLine();
String num2 = reader.readLine();
String num3 = reader.readLine();
int a = Integer.parseInt(num1);
int b = Integer.parseInt(num2);
int c = Integer.parseInt(num3);
if (a >= c || b >= c) {
if (b <= c || a <= c)
System.out.println(c);
} else if (a >= b || c >= b) {
if (c <= b || a <= b)
System.out.println(b);
} else if (b >= a || c >= a) {
if (c <= a || b <= a)
System.out.println(a);
else if (a == c && c == b) {
System.out.println(a);
} else if (a == c && c != b || a == b && b != c) {
System.out.println(a);
}else if(b==c && c!=a || b==a && a!=c )
System.out.println(b);
}
}
}