как писать правильно условие а=b=c? не могу понять помогите
package com.javarush.task.task04.task0417;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Существует ли пара?
*/
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String x = reader.readLine();
String y = reader.readLine();
String z = reader.readLine();
int a = Integer.parseInt(x);
int b = Integer.parseInt(y);
int c = Integer.parseInt(z);
if (a == b), (b == c) {
System.out.println(a + " " + b + " " + c);
}
else {
if (a == b) {
System.out.println(a + " " + b);
}
else {
if (b == c) {
System.out.println(b + " " + c);
}
else {
if (a == c) {
System.out.println(a + " " + c);
}
}
}
}
}
}