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

string a;

bool f() {
	int i;
	bool v[150] = {};
	for (i = 0; a[i]; i++) {
		if (v[a[i]]) return 0;
		v[a[i]] = 1;
	}
	return 1;
}

int main()
{
	int i, j, k;
	cin >> a;
	a += 'a' - 1;
	for (i = a.size() - 1; i >= 0; i--) {
		for (j = a[i] + 1; j <= 'z'; j++) {
			a[i] = j;
			if (f()) {
				for (k = 0; a[k]; k++) cout << a[k];
				return 0;
			}
		}
		a[i] = '\0';
	}
    cout << "-1" << endl;
    return 0;
}