Не совсем понимаю почему не выполняется условие для трех.
package com.javarush.task.pro.task03.task0305;
import java.util.Scanner;
/*
Три числа
*/
public class Solution {
public static void main(String[] args) {
//напишите тут ваш код
Scanner numbers = new Scanner(System.in);
int first = numbers.nextInt();
int second = numbers.nextInt();
int third = numbers.nextInt();
if (first == second)
System.out.println(first + " " + second);
else
{
if(second == third)
System.out.println(second + " " + third);
else
{
if(first == third)
System.out.println(first + " " + third);
else
{
if((first == second) && (first == third))
System.out.println(first + " " + second + " " + third);
}
}
}
}
}