#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 7;
const int infint = (int)1e9;
string s;
int a[26];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> s;
	for (int i = 0; i < s.size(); i++)
		a[s[i] - 'a'] = 1;
	for (int i = 0; i < 26; i++)
		if(a[i] == 0)
		{
			cout << s;
			cout << (char)('a' + i);
			return 0;
		}
	vector<int> p, q;
	for (int i = 0; i < s.size(); i++)
		p.push_back(s[i] - 'a'), q.push_back(s[i] - 'a');
	if(next_permutation(p.begin(), p.end()) == 0)
		return cout << -1, 0;
	for (int i = 0; i < p.size(); i++)
	{
		cout <<(char)(p[i] + 'a');
		if(p[i] != q[i])
			break;
	}
}