#include <iostream>
#include <cstring>
using namespace std;
const int MAX_SIZE = 2000;
const int LAST_LETTER = 'z';
bool isLetter(char c) {
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}
void addWords(char words[][MAX_SIZE + 1], char text[], int &lastPos) {
int length = strlen(text);
bool wasLetter = false;
for (int i = 0; i <= length; ++i) {
if (isLetter(text[i])) {
char c[] = {text[i], 0};
strcat(words[lastPos], c);
wasLetter = true;
} else if (wasLetter) {
++lastPos;
wasLetter = false;
}
}
}
void interchangeSeq(char firstWord[], char secondWord[]) {
char aux[MAX_SIZE + 1];
strcpy(aux, firstWord);
strcpy(firstWord, secondWord);
strcpy(secondWord, aux);
}
void sortWords(char words[][MAX_SIZE + 1]) {
for (int i = 0; words[i][0]; ++i) {
for (int j = i + 1; words[j][0]; ++j) {
if (strcmp(words[i], words[j]) > 0) {
interchangeSeq(words[i], words[j]);
}
}
}
}
bool isLowerLetter(char c) {
return 'a' <= c && c <= 'z';
}
const char* greatestWord(char words[][MAX_SIZE + 1]) {
for (int i = 0; words[i][0]; ++i) {
int fr[LAST_LETTER + 1] = {0}, n = strlen(words[i]);
for (int j = 0; j <= n; ++j) {
++fr[words[i][j]];
if (fr[words[i][j]] > 1) {
break;
} else if (words[i][j] == 0) {
return words[i];
}
}
}
return "Ist nicht vorhanden!";
}
int main() {
char text[MAX_SIZE + 1], words[MAX_SIZE / 2 + 1][MAX_SIZE + 1] = {0};
int lastPos = 0;
while (cin.getline(text, MAX_SIZE + 1)) {
addWords(words, text, lastPos);
}
sortWords(words);
cout << greatestWord(words);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIApjb25zdCBpbnQgTUFYX1NJWkUgPSAyMDAwOwpjb25zdCBpbnQgTEFTVF9MRVRURVIgPSAneic7CiAKYm9vbCBpc0xldHRlcihjaGFyIGMpIHsKICAgIHJldHVybiAoJ0EnIDw9IGM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U2VxKHdvcmRzW2ldLCB3b3Jkc1tqXSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0KIApib29sIGlzTG93ZXJMZXR0ZXIoY2hhciBjKSB7CiAgICByZXR1cm4gJ2EnIDw9IGMgJiYgYyA8PSAneic7Cn0KCmNvbnN0IGNoYXIqIGdyZWF0ZXN0V29yZChjaGFyIHdvcmRzW11bTUFYX1NJWkUgKyAxXSkgewogICAgZm9yIChpbnQgaSA9IDA7IHdvcmRzW2ldWzBdOyArK2kpIHsKICAgICAgICBpbnQgZnJbTEFTVF9MRVRURVIgKyAxXSA9IHswfSwgbiA9IHN0cmxlbih3b3Jkc1tpXSk7CiAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPD0gbjsgKytqKSB7CiAgICAgICAgICAgICsrZnJbd29yZHNbaV1bal1dOwogICAgICAgICAgICBpZiAoZnJbd29yZHNbaV1bal1dID4gMSkgewogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0gZWxzZSBpZiAod29yZHNbaV1bal0gPT0gMCkgewogICAgICAgICAgICAgICAgcmV0dXJuIHdvcmRzW2ldOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuICJJc3QgbmljaHQgdm9yaGFuZGVuISI7Cn0KIAppbnQgbWFpbigpIHsKICAgIGNoYXIgdGV4dFtNQVhfU0laRSArIDFdLCB3b3Jkc1tNQVhfU0laRSAvIDIgKyAxXVtNQVhfU0laRSArIDFdID0gezB9OwogICAgaW50IGxhc3RQb3MgPSAwOwogICAgd2hpbGUgKGNpbi5nZXRsaW5lKHRleHQsIE1BWF9TSVpFICsgMSkpIHsKICAgICAgICBhZGRXb3Jkcyh3b3JkcywgdGV4dCwgbGFzdFBvcyk7CiAgICB9CiAgICBzb3J0V29yZHMod29yZHMpOwogICAgY291dCA8PCBncmVhdGVzdFdvcmQod29yZHMpOwogICAgcmV0dXJuIDA7Cn0=