#include <iostream>
#include <sstream>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
bool has_all_distinct_letters(const std::string& word) {
std::set<char> letters;
for (char c : word) {
if (letters.find(c) != letters.end()) {
return false; // If the letter already exists, return false
}
letters.insert(c);
}
return true; // All letters are distinct
}
int main() {
std::string line;
std::vector<std::string> words;
// Citirea textului de intrare
while (std::getline(std::cin, line)) {
std::istringstream stream(line);
std::string word;
while (stream >> word) {
words.push_back(word);
}
}
std::string longest_distinct_word;
// Căutarea celui mai lung cuvânt cu litere distincte
for (const std::string& word : words) {
if (has_all_distinct_letters(word) && word.length() > longest_distinct_word.length()) {
longest_distinct_word = word;
}
}
if (!longest_distinct_word.empty()) {
std::cout << longest_distinct_word << std::endl;
} else {
std::cout << "Ist nicht vorhanden!" << std::endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGFsZ29yaXRobT4KCmJvb2wgaGFzX2FsbF9kaXN0aW5jdF9sZXR0ZXJzKGNvbnN0IHN0ZDo6c3RyaW5nJiB3b3JkKSB7CiAgICBzdGQ6OnNldDxjaGFyPiBsZXR0ZXJzOwogICAgZm9yIChjaGFyIGMgOiB3b3JkKSB7CiAgICAgICAgaWYgKGxldHRlcnMuZmluZChjKSAhPSBsZXR0ZXJzLmVuZCgpKSB7CiAgICAgICAgICAgIHJldHVybiBmYWxzZTsgLy8gSWYgdGhlIGxldHRlciBhbHJlYWR5IGV4aXN0cywgcmV0dXJuIGZhbHNlCiAgICAgICAgfQogICAgICAgIGxldHRlcnMuaW5zZXJ0KGMpOwogICAgfQogICAgcmV0dXJuIHRydWU7IC8vIEFsbCBsZXR0ZXJzIGFyZSBkaXN0aW5jdAp9CgppbnQgbWFpbigpIHsKICAgIHN0ZDo6c3RyaW5nIGxpbmU7CiAgICBzdGQ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