import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
String first, second, third;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
first = br.readLine();
second = br.readLine();
third = br.readLine();
int det = 0;
int k = 0;
for (int i = 0; i < 100; i++) {
if (first.charAt(i) > second.charAt(i)) {
det = 12;
break;
} else if (first.charAt(i) < second.charAt(i)) {
det = 21;
break;
}
}
al:
if (true) {
if (det == 12) {
for (int i = 0; i < 100; i++) {
if (first.charAt(i) > third.charAt(i)) {
for (int j = 0; j < 100; j++) {
if (second.charAt(j) > third.charAt(j)) {
System.out.println(third + " " + second + " " + first);
k = 1;
break al;
} else if (second.charAt(j) < third.charAt(j)) {
System.out.println(second + " " + third + " " + first);
k = 1;
break al;
}
}
} else if (first.charAt(i) < third.charAt(i)) {
if (k == 1) break;
else {
System.out.println(second + " " + first + " " + third);
break al;
}
}
}
} else if (det == 21) {
for (int i = 0; i < 100; i++) {
if (second.charAt(i) > third.charAt(i)) {
for (int j = 0; j < 100; j++) {
if (first.charAt(j) > third.charAt(j)) {
System.out.println(third + " " + first + " " + second);
k = 1;
break al;
} else if (second.charAt(j) < third.charAt(j)) {
System.out.println(first + " " + third + " " + second);
k = 1;
break al;
}
}
} else if (second.charAt(i) < third.charAt(i)) {
if (k == 1) break;
else {
System.out.println(first + " " + second + " " + third);
break al;
}
}
}
}
}
}
}
어떻게 풀긴 풀었는데 이 코드는 왜 WA가 나오는지 알 수 있을까요???ㅠㅠ