Почему то не хочет считать при равных числах. Почему?
package com.javarush.task.task04.task0420;
/*
Сортировка трех чисел
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int max = 0;
int min = 0;
int mid = 0;
if ((a>b) && (a>c)) {
max = a;}
else if ((b>a) && (b>c)) {
max = b; }
else {
max = c;}
if ((a<b) && (a<c)) {
min = a;}
else if ((b<a) && (b<c)) {
min = b; }
else {
min = c;}
mid = (a+b+c-max-min);
System.out.println(max+" "+mid+" "+min);
}
}