import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
static final int LAST_LETTER = 'z';
static boolean isLetter(char c) {
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}
static boolean hasDistinctLetters
(String text
) { int[] fr = new int[LAST_LETTER + 1];
int length = text.length();
for (int i = 0; i < length; ++i) {
++fr[text.charAt(i)];
if (fr[text.charAt(i)] > 1) {
return false;
}
}
return true;
}
static boolean moreAbsurd
(String firstText,
String secondText
) { int firstLen = firstText.length(), secondLen = secondText.length();
return hasDistinctLetters(firstText) && (firstLen > secondLen || (firstLen == secondLen && firstText.compareTo(secondText) < 0));
}
static void distinctLettersLargestWord
(String text, StringBuilder absurdWord
) { int length = text.length();
StringBuilder currentWord = new StringBuilder();
boolean wasLetter = false;
for (int i = 0; i < length; ++i) {
if (isLetter(text.charAt(i))) {
currentWord.append(text.charAt(i));
wasLetter = true;
} else if (wasLetter) {
if (moreAbsurd(currentWord.toString(), absurdWord.toString())) {
absurdWord.setLength(0);
absurdWord.append(currentWord);
}
currentWord = new StringBuilder();
wasLetter = false;
}
}
if (wasLetter && moreAbsurd(currentWord.toString(), absurdWord.toString())) {
absurdWord.setLength(0);
absurdWord.append(currentWord);
}
}
StringBuilder absurdWord = new StringBuilder();
while (reader.ready()) {
text = reader.readLine();
distinctLettersLargestWord(text, absurdWord);
}
if (absurdWord.length() != 0) {
System.
out.
println(absurdWord
); } else {
System.
out.
println("Ist nicht vorhanden!"); }
}
}