import java.util.Scanner;
public class Main {
public static void main
(String[] args
) { int count = 0;
Scanner scanner
= new Scanner
(System.
in);
while (true) {
String line
= scanner.
nextLine();
if (line.equals("end")) {
break;
}
if (count >= data.length) {
for (int i = 0; i < count; i++) {
tmp[i] = data[i];
}
data = tmp;
}
data[count++] = line;
}
bubblesort(data, 0, count);
for (int i = 0; i < count; i++) {
}
}
public static void bubblesort
(String[] data,
int start,
int last
) { for (int i = last - 1; i > start; i--) {
for (int j = start; j < i; j++) {
if (data[j].compareTo(data[j + 1]) > 0) {
swap(data, j, j + 1);
}
}
}
}
public static void swap
(String[] data,
int x,
int y
) { data[x] = data[y];
data[y] = tmp;
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKcHVibGljIGNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIFN0cmluZ1tdIGRhdGEgPSBuZXcgU3RyaW5nWzFdOwogICAgICAgIGludCBjb3VudCA9IDA7CiAgICAgICAgU2Nhbm5lciBzY2FubmVyID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgICAKICAgICAgICB3aGlsZSAodHJ1ZSkgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50KCI+ICIpOwogICAgICAgICAgICBTdHJpbmcgbGluZSA9IHNjYW5uZXIubmV4dExpbmUoKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIGlmIChsaW5lLmVxdWFscygiZW5kIikpIHsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpZiAoY291bnQgPj0gZGF0YS5sZW5ndGgpIHsKICAgICAgICAgICAgICAgIFN0cmluZ1tdIHRtcCA9IG5ldyBTdHJpbmdbZGF0YS5sZW5ndGggKiAyXTsKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgdG1wW2ldID0gZGF0YVtpXTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgZGF0YSA9IHRtcDsKICAgICAgICAgICAgfQogICAgICAgICAgICAKICAgICAgICAgICAgZGF0YVtjb3VudCsrXSA9IGxpbmU7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIGJ1YmJsZXNvcnQoZGF0YSwgMCwgY291bnQpOwogICAgICAgIAogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oZGF0YVtpXSk7CiAgICAgICAgfQogICAgfQogICAgCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgYnViYmxlc29ydChTdHJpbmdbXSBkYXRhLCBpbnQgc3RhcnQsIGludCBsYXN0KSB7CiAgICAgICAgZm9yIChpbnQgaSA9IGxhc3QgLSAxOyBpID4gc3RhcnQ7IGktLSkgewogICAgICAgICAgICBmb3IgKGludCBqID0gc3RhcnQ7IGogPCBpOyBqKyspIHsKICAgICAgICAgICAgICAgIGlmIChkYXRhW2pdLmNvbXBhcmVUbyhkYXRhW2ogKyAxXSkgPiAwKSB7CiAgICAgICAgICAgICAgICAgICAgc3dhcChkYXRhLCBqLCBqICsgMSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICAKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzd2FwKFN0cmluZ1tdIGRhdGEsIGludCB4LCBpbnQgeSkgewogICAgICAgIFN0cmluZyB0bXAgPSBkYXRhW3hdOwogICAgICAgIGRhdGFbeF0gPSBkYXRhW3ldOwogICAgICAgIGRhdGFbeV0gPSB0bXA7CiAgICB9Cn0=