#include <iostream>
#include <string>
using namespace std;
bool isValid(int frq[], string word) {
for (int i = 0; i <= 'z'; ++i) {
frq[i] = 0;
}
for (int i = 0; i < word.size(); ++i) {
++frq[word[i]];
if (frq[word[i]] > 1) {
return false;
}
}
return true;
}
int main() {
string text;
string maxWord = "";
while (getline(cin, text)) {
int len = (int)text.size();
string currWord = "";
for (int i = 0; i <= len; ++i) {
if (isalpha(text[i])) {
currWord += text[i];
} else if (!currWord.empty()) {
int frq['z' + 1] = {0};
int index = 0;
string currMax = "";
while (frq[currWord[index]] == 0) {
++frq[currWord[index]];
if (frq[currWord[index]] == 1) {
currMax += currMax[index];
}
++index;
}
i += (index - 1);
if (currMax.size() > maxWord.size() || (currMax.size() == maxWord.size() && currMax < maxWord)) {
maxWord = currMax;
}
currWord.clear();
}
}
for (int k = 0; k < maxWord.size(); ++k) {
cout << maxWord[k];
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKYm9vbCBpc1ZhbGlkKGludCBmcnFbXSwgc3RyaW5nIHdvcmQpIHsKICAgIGZvciAoaW50IGkgPSAwOyBpIDw9ICd6JzsgKytpKSB7CiAgICAgICAgZnJxW2ldID0gMDsKICAgIH0KICAgIGZvciAoaW50IGkgPSAwOyBpIDwgd29yZC5zaXplKCk7ICsraSkgewogICAgICAgICsrZnJxW3dvcmRbaV1dOwogICAgICAgIGlmIChmcnFbd29yZFtpXV0gPiAxKSB7CiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfQoKCmludCBtYWluKCkgewogICAgc3RyaW5nIHRleHQ7CiAgICBzdHJpbmcgbWF4V29yZCA9ICIiOwogICAgd2hpbGUgKGdldGxpbmUoY2luLCB0ZXh0KSkgewogICAgICAgIGludCBsZW4gPSAoaW50KXRleHQuc2l6ZSgpOwogICAgICAgIHN0cmluZyBjdXJyV29yZCA9ICIiOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDw9IGxlbjsgKytpKSB7CiAgICAgICAgICAgIGlmIChpc2FscGhhKHRleHRbaV0pKSB7CiAgICAgICAgICAgICAgICBjdXJyV29yZCArPSB0ZXh0W2ldOwogICAgICAgICAgICB9IGVsc2UgaWYgKCFjdXJyV29yZC5lbXB0eSgpKSB7CiAgICAgICAgICAgICAgICBpbnQgZnJxWyd6JyArIDFdID0gezB9OwogICAgICAgICAgICAgICAgaW50IGluZGV4ID0gMDsKICAgICAgICAgICAgICAgIHN0cmluZyBjdXJyTWF4ID0gIiI7CiAgICAgICAgICAgICAgICB3aGlsZSAoZnJxW2N1cnJXb3JkW2luZGV4XV0gPT0gMCkgewogICAgICAgICAgICAgICAgICAgICsrZnJxW2N1cnJXb3JkW2luZGV4XV07CiAgICAgICAgICAgICAgICAgICAgaWYgKGZycVtjdXJyV29yZFtpbmRleF1dID09IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY3Vyck1heCArPSBjdXJyTWF4W2luZGV4XTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKytpbmRleDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGkgKz0gKGluZGV4IC0gMSk7CiAgICAgICAgICAgICAgICBpZiAoY3Vyck1heC5zaXplKCkgPiBtYXhXb3JkLnNpemUoKSB8fCAoY3Vyck1heC5zaXplKCkgPT0gbWF4V29yZC5zaXplKCkgJiYgY3Vyck1heCA8IG1heFdvcmQpKSB7CiAgICAgICAgICAgICAgICAgICAgbWF4V29yZCA9IGN1cnJNYXg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBjdXJyV29yZC5jbGVhcigpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGZvciAoaW50IGsgPSAwOyBrIDwgbWF4V29yZC5zaXplKCk7ICsraykgewogICAgICAgIAljb3V0IDw8IG1heFdvcmRba107CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuIDA7Cn0K