I know there's another way to do this, but I wannna try to make this work.
Thanks in advance
package com.codegym.task.task04.task0420;
/*
Sorting three numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n1 = Integer.parseInt(reader.readLine());
int n2 = Integer.parseInt(reader.readLine());
int n3 = Integer.parseInt(reader.readLine());
int st = Math.max(n1,Math.max(n2,n3));
int nd = Math.min(n1,Math.min(n2,n3));
int rd;
if (n1<st & n1>nd)
rd = n1;
else if (n2<st & n2>nd)
rd = n2;
else if (n3<st && n3>nd)
rd = n3;
else if (n1==st || n1==nd)
rd=n1;
else if (n2==st || n2==nd)
rd=n2;
else
rd=n3;
System.out.println(st +" " + rd +" "+ nd);
}
}