#include <iostream>
#include <cstring>
using namespace std;

const int MAX_SIZE = 100;

void copySmaller(char lexicoSmall[], char text[]) {
    int smallerLen = strlen(lexicoSmall);
    if (smallerLen == 0 || smallerLen > strlen(text)) {
        strcpy(lexicoSmall, text);
    }
}

bool haveDistinctLetters(char text[]) {
	const int MAX_SIZE = (int)'z';
	int textLen = strlen(text), fr[MAX_SIZE + 1] = {0};
	for (int i = 0; i < textLen; ++i) {
		++fr[(int)text[i]];
		if (fr[(int)text[i]] > 1) {
			return false;
		}
	}
	return true;
}

void findLargerDistinct(char lexicoLarge[], char text[]) {
    int largeLen = strlen(lexicoLarge);
    if (haveDistinctLetters(text) && (largeLen == 0 || largeLen < strlen(text))) {
        strcpy(lexicoLarge, text);
    }
}

int main() {
    char text[MAX_SIZE + 1], lexicoSmall[MAX_SIZE + 1] = "", lexicoLarge[MAX_SIZE + 1] = "";
    while (cin >> text) {
        copySmaller(lexicoSmall, text);
        findLargerDistinct(lexicoLarge, text);
    }
    if (strlen(lexicoLarge)) {
        cout << lexicoLarge;        
    } else {
        cout << lexicoSmall;
    }
    return 0;
}