#include<cstdio>

int main() {
	char s[27];
	bool appear[26];
	for(int i=0;i<26;i++) appear[i] = false;
	scanf("%26s", s);
	for(int i=0;s[i]!='\0';i++) appear[s[i]-'a'] = true;
	char c = '\0';
	for(int i=0;i<26;i++) if(!appear[i]) {
		c = 'a' + i;
		break;
	}
	if(c != '\0') {
		printf("%s%c\n", s, c);
	} else { // strlen(s) == 26
		int i;
		for(i=25;i>=0;i--) {
			char m = 0x7f;
			for(int j=i+1;j<26;j++) if(s[i] < s[j] && s[j] < m) m = s[j];
			if(m != 0x7f) {
				s[i] = m;
				s[i+1] = '\0';
				break;
			}
		}
		if(i < 0) printf("-1\n");
		else printf("%s\n", s);
	}
	return 0;
}
