Но все ровно не подходит
package com.javarush.task.task04.task0417;
/*
Существует ли пара?
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader day = new BufferedReader(new InputStreamReader(System.in));
String age = day.readLine();
int x = Integer.parseInt(age);
String age2 = day.readLine();
int y = Integer.parseInt(age2);
String age3 = day.readLine();
int z = Integer.parseInt(age3);
if (x == y)
System.out.println(x + " " + y);
if (x == z)
System.out.println(x + " " + z);
if (z == y)
System.out.println(z + " " + y);
//if (x == y)
//System.out.println(x + " " + y);
if (x == y || x == z || y == z)
System.out.println(x + " " + y + " " + z);
}
}