You are given a string s consisting of |s| small english letters.

In one move you can replace any character of this string to the next character in alphabetical order (a will be replaced with b, s will be replaced with t, etc.). You cannot replace letter z with any other letter.

Your target is to make some number of moves (not necessary minimal) to get string abcdefghijklmnopqrstuvwxyz (english alphabet) as a subsequence. Subsequence of the string is the string that is obtained by deleting characters at some positions. You need to print the string that will be obtained from the given string and will be contain english alphabet as a subsequence or say that it is impossible.


-----Input-----

The only one line of the input consisting of the string s consisting of |s| (1 ≤ |s| ≤ 10^5) small english letters.


-----Output-----

If you can get a string that can be obtained from the given string and will contain english alphabet as a subsequence, print it. Otherwise print «-1» (without quotes).


-----Examples-----
Input
aacceeggiikkmmooqqssuuwwyy

Output
abcdefghijklmnopqrstuvwxyz

Input
thereisnoanswer

Output
-1

Source: codeforces | Difficulty: EASY
Tags: String algorithms

Greedy algorithms


Solutions:
s = list(input())
word = 'a'
for i in range(len(s)):
	if s[i] <= word:
		s[i] = word
		word = chr(ord(word) + 1)
	if word > 'z':
		break
if word <= 'z':
	print(-1)
else:
	print(''.join(s))


string = input()
start = 'a'
ans = []
for i in range(len(string)):
	if string[i] <= start and start <= 'z':
		ans.append(start)
		start = chr(ord(start) + 1)
	else:
		ans.append(string[i])
if start > 'z':
	for elem in ans:
		print(elem, end='')
else:
	print(-1)


def main():
	s = input()
	cnt = 0
	min_symbol = 96
	ord_list = [ord(el) for el in s]
	for (index, symbol) in enumerate(ord_list):
		if cnt == 26:
			break
		if symbol <= min_symbol + 1:
			ord_list[index] = min_symbol + 1
			min_symbol += 1
			cnt += 1
	if cnt != 26:
		print(-1)
		return
	print(''.join([chr(el) for el in ord_list]))
main()


a = input()
l = len(a)
a = [i for i in a]
if l < 26:
	print(-1)
else:
	p = 97
	for j in range(l):
		i = a[j]
		k = ord(i)
		if k <= p and p <= 97 + 25:
			a[j] = chr(p)
			p += 1
	if p >= 97 + 26:
		print(''.join(a))
	else:
		print(-1)


import math
s = input()
s = list(s)
n = len(s)
if n < 26:
	print(-1)
elif 'a' not in s:
	print(-1)
else:
	ind = s.index('a')
	if n - ind < 26:
		print(-1)
	else:
		i = 0
		j = 0
		k = 'abcdefghijklmnopqrstuvwxyz'
		k = list(k)
		while i < len(s):
			if j == 0 and s[i] == k[j]:
				i += 1
				j += 1
			elif j != 0 and j < 26 and (s[i] in k[:j + 1]):
				s[i] = k[j]
				j += 1
				i += 1
			else:
				i += 1
		if j > 25:
			for i1 in range(len(s)):
				print(s[i1], end='')
		else:
			print(-1)


s = input()
ans = ''
l = len(s)
idx = 0
for i in range(0, l):
	if idx < 26 and ord(s[i]) <= idx + 97:
		ans += chr(idx + 97)
		idx += 1
	else:
		ans += s[i]
if idx == 26:
	print(ans)
else:
	print('-1')


def main():
	S = input()
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	subs = []
	apnd = subs.append
	i = 0
	for s in S:
		if i < 26 and s <= alpha[i]:
			apnd(alpha[i])
			if i < 26:
				i += 1
		else:
			apnd(s)
	if i == 26:
		print(*subs, sep='')
	else:
		print(-1)
main()


text = input()
if len(text) < 26:
	print(-1)
else:
	initial = 'a'
	text = list(text)
	for i in range(len(text)):
		if text[i] <= initial:
			text[i] = initial
			initial = chr(ord(initial) + 1)
		if initial == chr(ord('z') + 1):
			for x in text:
				print(x, end='')
			exit()
	else:
		print(-1)


t = list(input())
f = 'abcdefghijklmnopqrstuvwxyz'
u = 0
h = 0
if len(t) < 26:
	print(-1)
else:
	for j in range(len(t)):
		if u == 0 and t[j] == 'a':
			u += 1
		elif f.index(t[j]) <= u:
			t[j] = f[u]
			u += 1
		if u == 26:
			print(''.join(t))
			h += 1
			break
	if h == 0:
		print(-1)


import sys, os

def main():
	ans = sys.stdin.readline().rstrip()
	chars = [ord(i) for i in list(ans)]
	idxes = []
	char = ord('a')
	minIdx = 0

	def findFirst(minIdx, char):
		for i in range(minIdx, len(chars)):
			if chars[i] <= char:
				return i
		return -1
	while len(idxes) < 26:
		x = findFirst(minIdx, char)
		if x == -1:
			break
		else:
			idxes.append(x)
			minIdx = x + 1
			char += 1
		if minIdx >= len(chars):
			break
		if char == ord('z') + 1:
			break
	if len(idxes) == 26:
		x = ord('a')
		for i in idxes:
			chars[i] = x
			x += 1
		print(''.join(map(chr, chars)))
		return
	print(-1)
main()


(z, zz, dgraphs, mod) = (input, lambda : list(map(int, z().split())), {}, 10 ** 9 + 7)
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
s = list(z())
(i, j) = (97, 0)
for c in s:
	if c <= chr(i):
		s[j] = chr(i)
		i += 1
	if i > 122:
		print(''.join(s))
		break
	j += 1
else:
	print(-1)


inp = input()
arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
now = 0
ans = ''
for i in range(len(inp)):
	if now != len(arr):
		if inp[i] <= arr[now]:
			ans += arr[now]
			now += 1
		else:
			ans += inp[i]
	else:
		ans += inp[i]
if now == len(arr):
	print(ans)
else:
	print(-1)


import sys
from sys import stdin, stdout
s = list(map(ord, list(stdin.readline())))
s.pop(-1)
if len(s) < 26:
	print(-1)
else:
	flag2 = True
	ctr = 26
	curr = 97
	for i in range(len(s)):
		if s[i] <= curr:
			ctr -= 1
			s[i] = curr
			curr += 1
		if ctr == 0:
			stdout.write(''.join(list(map(chr, s))))
			flag2 = False
			break
	if flag2:
		print(-1)


s = list(input())
target = 'abcdefghijklmnopqrstuvwxyz'
ind_t = 0
ind_s = 0
while ind_s < len(s) and ind_t < 26:
	if ord(s[ind_s]) <= ord(target[ind_t]):
		s[ind_s] = target[ind_t]
		ind_t += 1
		ind_s += 1
	else:
		ind_s += 1
if ind_t == 26:
	print(''.join(s))
else:
	print(-1)


s = input()
ch = 'a'
for i in range(len(s)):
	if s[i] <= ch <= 'z':
		s = s[:i] + ch + s[i + 1:]
		ch = chr(ord(ch) + 1)
print(-1 if ch <= 'z' else s)


x = input()
if len(x) < 26:
	print('-1')
else:
	c = 0
	a = list(x)
	for i in range(len(x)):
		if c == 26:
			break
		if ord(a[i]) - 97 == c:
			c += 1
		elif ord(a[i]) - 97 < c:
			a[i] = chr(c + 97)
			c += 1
	if c < 26:
		print('-1')
	else:
		print(''.join(a))


import math
s = input()
alf = 'abcdefghijklmnopqrstuvwxyz'
n = -1

def con_str(string, ch, i):
	return string[:i] + ch + string[i + 1:]
for i in alf:
	flag = False
	for j in range(n + 1, len(s)):
		if s[j] <= i:
			n = j
			s = con_str(s, i, j)
			flag = True
			break
	if not flag:
		print(-1)
		return
print(s)


s = input()
k = 0
s_ans = ''
for i in range(len(s)):
	if ord(s[i]) - ord('a') <= k and k < 26:
		s_ans += chr(k + ord('a'))
		k += 1
	else:
		s_ans += s[i]
if k == 26:
	print(s_ans)
else:
	print(-1)


s = [c for c in input()]
current_char = 97
for i in range(len(s)):
	if current_char == 123:
		continue
	elif ord(s[i]) <= current_char:
		s[i] = chr(current_char)
		current_char += 1
if current_char < 123:
	print(-1)
else:
	print(''.join(s))


s = list(input())
t = 'abcdefghijklmnopqrstuvwxyz'
cur = 0
for i in range(len(s)):
	if s[i] <= t[cur]:
		s[i] = t[cur]
		cur += 1
		if cur == len(t):
			break
print(''.join(s) if cur == len(t) else -1)


a = list(input())
if len(a) < 26:
	print(-1)
	exit(0)
else:
	try:
		i = a.index('a') + 1
		x = 1
		while x < 26 and i < len(a):
			if ord(a[i]) <= ord('a') + x:
				a[i] = chr(ord('a') + x)
				x += 1
			i += 1
	except:
		print(-1)
		exit(0)
if x < 26:
	print(-1)
else:
	print(''.join(a))


s = input()
p = ''
k = 'abcdefghijklmnopqrstuvwxyzz'
check = False
i = 0
for c in s:
	if c <= k[i] and (not check):
		p += k[i]
		i += 1
		if i == 26:
			check = True
	else:
		p += c
print(p if check else -1)


s = list(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
j = 0
for i in range(len(s)):
	if s[i] <= alp[j]:
		s[i] = alp[j]
		j += 1
	if j == 26:
		print(''.join(s))
		break
else:
	print(-1)


s = list(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = {u: v for (u, v) in zip(alphabet, alphabet[1:])}
shift['z'] = None

def convert(s):
	if len(s) < 26:
		return -1
	search_char = 'a'
	for (i, char) in enumerate(s):
		if not search_char:
			return ''.join(s)
		if char == search_char:
			search_char = shift[search_char]
		elif char < search_char:
			s[i] = search_char
			search_char = shift[search_char]
	if not search_char:
		return ''.join(s)
	return -1
print(convert(s))


s = input()
ls = len(s)
if ls < 26:
	print(-1)
	quit()
findc = 'a'
i = 0
while i < ls:
	if ord(s[i]) <= ord(findc):
		s = s[:i] + findc + s[i + 1:]
		findc = chr(ord(findc) + 1)
	if ord(findc) > ord('z'):
		print(s)
		quit()
	i += 1
print(-1)


s = input()
n = len(s)
t = []
x = 'a'
for i in range(n):
	if s[i] <= x and ord(x) <= ord('z'):
		t.append(x)
		x = chr(ord(x) + 1)
	else:
		t.append(s[i])
if ord(x) > ord('z'):
	print(*t, sep='')
else:
	print(-1)


s = 'abcdefghijklmnopqrstuvwxyz'
ln = {k: v for (v, k) in dict(enumerate(s)).items()}
a = input()
npp = [ln[i] for i in a]
spp = [ln[i] for i in s]

def sol(npp, a):
	ssi = 0
	ans = []
	for (letter, number_or, it) in zip(a, npp, range(len(npp))):
		if number_or <= spp[ssi]:
			ans.append(s[ssi])
			ssi += 1
		else:
			ans.append(letter)
		if ssi >= len(s):
			ans.extend(a[it + 1:])
			break
	if ssi < len(s):
		return -1
	return ''.join(ans)
print(sol(npp, a))


l = list(input())
a = 97
b = 0
for h in l:
	if h <= chr(a):
		l[b] = chr(a)
		a += 1
	if a > 122:
		print(''.join(l))
		break
	b += 1
else:
	print('-1')


s = input()
if len(s) < 26:
	print(-1)
else:
	x = 97
	ans = ''
	for i in range(len(s)):
		if x > 122:
			ans += s[i]
		elif ord(s[i]) <= x:
			ans += chr(x)
			x += 1
		else:
			ans += s[i]
	if x > 122:
		print(ans)
	else:
		print(-1)


def replace_character(word, pos, new_letter):
	string_list = list(word)
	string_list[pos] = str(new_letter)
	word = ''.join(string_list)
	return word
word = input()
letter = 'a'
letters_matched = 0
for i in range(0, len(word)):
	if letters_matched == 26:
		break
	if ord(word[i]) <= ord(letter):
		word = replace_character(word, i, letter)
		letters_matched += 1
		letter = chr(ord(letter) + 1)
if letters_matched == 26:
	print(word)
else:
	print(-1)


z = 97
k = input().replace('', ' ').split()
for i in range(len(k)):
	if k[i] <= chr(z):
		k[i] = chr(z)
		z += 1
	if z > 122:
		exit(print(*k, sep=''))
print(-1)


s = input()
d = {}
c = 'a'
for i in range(len(s)):
	if s[i] <= c:
		d[c] = i
		if c != 'z':
			c = chr(ord(c) + 1)
		else:
			break
s = list(s)
if len(d) == 26:
	for e in d:
		s[d[e]] = e
	print(''.join(s))
else:
	print(-1)


from string import ascii_lowercase
s = list(input())
symbs = ascii_lowercase
cursymbol = 0
for d in range(len(s)):
	if s[d] <= ascii_lowercase[cursymbol]:
		s[d] = ascii_lowercase[cursymbol]
		if ascii_lowercase[cursymbol] == 'z':
			print(''.join(s))
			return
		cursymbol += 1
print(-1)


x = list(input())
l = 'a'
cl = 0
f = 1
for i in range(len(x)):
	if x[i] == chr(ord(l) + 1) and cl >= 1:
		l = x[i]
		cl = 1
		if l == 'z':
			f = 0
			break
	elif x[i] == l:
		if cl == 0:
			cl += 1
		elif cl >= 1:
			x[i] = chr(ord(l) + 1)
			l = chr(ord(l) + 1)
			cl = 1
			if l == 'z':
				f = 0
				break
	elif x[i] < l:
		x[i] = chr(ord(l) + 1)
		l = chr(ord(l) + 1)
		cl = 1
		if l == 'z':
			f = 0
			break
if f == 1:
	print(-1)
else:
	print(''.join(x))


s = input()
n = len(s)
ns = ''
count = 97
if n < 26:
	print(-1)
else:
	for i in range(n):
		if count <= 122 and ord(s[i]) <= count:
			ns += chr(count)
			count += 1
		else:
			ns += s[i]
	if count <= 122:
		print(-1)
	else:
		print(ns)


s = input()
n = len(s)
cur = 'a'
i = 0
while i < n and cur != '{':
	while i + 1 < n and ord(s[i]) > ord(cur):
		i += 1
	s = s[:i] + cur + s[i + 1:]
	cur = chr(ord(cur) + 1)
	i += 1
if i == n and cur != '{':
	print(-1)
else:
	print(s)


s = list(input())
alf = list('abcdefghijklmnopqrstuvwxyz')
count = 0
for i in range(len(s)):
	if alf.index(s[i]) <= count:
		s[i] = alf[count]
		count += 1
	if count == 26:
		print(''.join(s))
		exit(0)
print(-1)


s = list(input())
n = len(s)
i = 0
j = 0
while i < n and j < 26:
	if ord(s[i]) <= ord('a') + j:
		s[i] = chr(ord('a') + j)
		j = j + 1
	i = i + 1
if j < 26:
	print(-1)
else:
	for i in range(n):
		print(s[i], end='')


s = input()
arr = list(s)
s = 97
for i in range(len(arr)):
	x = ord(arr[i])
	if x <= s:
		arr[i] = chr(s)
		s += 1
		if s == 123:
			break
if s == 123:
	print(''.join(arr))
else:
	print(-1)


alpha = 'abcdefghijklmnopqrstuvwxyz'
s = input()
ans = []
i = 0
for c in s:
	if i < 26 and c <= alpha[i]:
		ans.append(alpha[i])
		i += 1
	else:
		ans.append(c)
if i == 26:
	for c in ans:
		print(c, end='')
else:
	print(-1)


a = input()
now = 'a'
ans = ''

def increChar(c):
	return chr(ord(c) + 1)
for i in range(0, len(a), 1):
	if a[i] <= now and now <= 'z':
		ans += now
		now = increChar(now)
	else:
		ans += a[i]
if now <= 'z':
	print(-1)
else:
	print(ans)


def printf(a):
	ans = ''
	for i in a:
		ans += i
	print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
ans = list(input())
index = 0
for i in reversed(range(len(ans))):
	if alph.index(ans[i]) >= index:
		ans[i] = alph[index]
		index += 1
	if index == 26:
		printf(ans)
		exit()
print(-1)


s = list(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
index = 0
if len(s) < len(alpha):
	print(-1)
	exit(0)
for i in range(len(s)):
	if s[i] <= alpha[index]:
		s[i] = alpha[index]
		index += 1
	if index == len(alpha):
		break
if index != len(alpha):
	print(-1)
	exit(0)
print(*s, sep='')


s = list(str(input()))
char = 'a'
if 'a' in s:
	x = s.index('a')
	for i in range(x + 1, len(s)):
		if ord(s[i]) <= ord(char) + 1:
			s[i] = chr(ord(char) + 1)
			char = chr(ord(char) + 1)
		if char == 'z':
			break
	if char == 'z':
		print(''.join(s))
	else:
		print('-1')
else:
	print('-1')


s = input()
n = len(s)
sList = list(s)
isCompleted = False
cnt = 0
for i in range(n):
	if cnt >= 26:
		break
	if ord(sList[i]) <= ord('a') + cnt:
		sList[i] = chr(ord('a') + cnt)
		cnt += 1
if cnt != 26:
	print(-1)
else:
	print(''.join(sList))


need = range(26)
data = list(input())
for i in range(len(data)):
	data[i] = ord(data[i]) - 97
fInd = 0
sInd = 0
out = [0] * len(data)
while fInd < len(data) and sInd < 26:
	if data[fInd] > need[sInd]:
		out[fInd] = data[fInd]
		fInd += 1
	else:
		out[fInd] = need[sInd]
		sInd += 1
		fInd += 1
if sInd < 26:
	print(-1)
else:
	for i in range(fInd, len(data)):
		out[i] = data[i]
	for i in range(len(data)):
		out[i] = chr(out[i] + 97)
	print(''.join(out))


s = input()
d = []
k = -1
ans = ''
for i in range(len(s)):
	d.append(ord(s[i]) - 97)
target = 0
for i in range(len(s)):
	if d[i] <= target and target <= 25:
		target += 1
		ans += chr(96 + target)
	else:
		ans += s[i]
if target >= 26:
	print(ans)
else:
	print(-1)


(s, r, l) = (input(), 1, 0)
for i in range(len(s)):
	if r > ord(s[i]) - 97:
		s = s[:i] + chr(96 + r) + s[i + 1:]
		r += 1
	if r == 27:
		l = 1
		break
print(s if l else -1)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
s = [x for x in input()]
t = 'abcdefghijklmnopqrstuvwxyz'
si = 0
for u in t:
	if si >= len(s):
		print(-1)
		exit(0)
	while si < len(s) and s[si] > u:
		si += 1
	if si < len(s):
		s[si] = u
		si += 1
	else:
		print(-1)
		exit(0)
print(''.join(s))


s = input()
l = len(s)
cur = 'a'
s2 = ''
for i in range(l):
	if ord(s[i]) <= ord(cur):
		s2 += cur
		cur = chr(ord(cur) + 1)
	else:
		s2 += s[i]
	if ord(cur) > ord('z'):
		s2 += s[i + 1:]
		print(s2)
		quit()
print(-1)


s = [ord(x) for x in input()]
x = ord('a')
for (i, c) in enumerate(s):
	if c > x:
		continue
	s[i] = x
	x += 1
	if x > ord('z'):
		f = 0
		break
else:
	f = 1
if f:
	print(-1)
else:
	print(''.join((chr(x) for x in s)))


alphabetInput = input()
sortedLetters = []
sub = []
badInput = False
last = ''
for letter in alphabetInput:
	if badInput == True:
		break
	curr = ord(letter)
	if 97 <= curr and curr <= 122:
		if last == '' and curr == 97:
			sortedLetters.append(chr(curr))
			sub.append(chr(curr))
			last = curr
			continue
		elif last == '':
			sortedLetters.append(chr(curr))
			continue
		if last + 1 >= curr and last < 122:
			sub.append(chr(last + 1))
			sortedLetters.append(chr(last + 1))
			last = last + 1
		else:
			sortedLetters.append(chr(curr))
	else:
		badInput = True
if badInput == True or len(sub) != 26:
	print(-1)
else:
	print(''.join(sortedLetters))


s = list(input())
i = 97
for j in range(len(s)):
	c = chr(i)
	if s[j] <= c:
		s[j] = c
		i += 1
		if i > 122:
			print(''.join(s))
			break
else:
	print(-1)


inp = input()
alph = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
curr = ord('a')
for i in range(0, len(inp)):
	if curr == ord('z') + 1:
		ans += inp[i:]
		break
	if curr >= ord(inp[i]):
		ans += chr(curr)
		curr += 1
	else:
		ans += inp[i]
if curr == ord('z') + 1:
	print(ans, end='')
else:
	print('-1', end='')


s = input()
alpha = 'abcdefghijklmnopqrstuvwxyz'
c = 0
cnt = 0
ans = ''
while cnt < len(s) and c < 26:
	if ord(s[cnt]) - ord('a') <= c:
		ans += alpha[c]
		c += 1
	else:
		ans += s[cnt]
	cnt += 1
if c == 26:
	ans += s[cnt:]
	print(ans)
else:
	print(-1)


t = 'abcdefghijklmnopqrstuvwxyz'
j = 0
s = list(input())
flag = False
for i in range(len(s)):
	if t[j] == 'z':
		s[i] = t[j]
		flag = True
		break
	if s[i] <= t[j]:
		s[i] = t[j]
		j += 1
if flag:
	print(''.join(s))
else:
	print(-1)


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
s = I1().strip()
s1 = 'abcdefghijklmnopqrstuvwxyz'
n = len(s)
(j, ans) = (n - 1, 0)
for i in range(25, -1, -1):
	while j >= 0:
		if s1[i] >= s[j]:
			s = s[:j] + s1[i] + s[j + 1:]
			ans += 1
			j -= 1
			break
		j -= 1
if ans == 26:
	print(s)
else:
	print('-1')


s = input()

def solve(s):
	if len(s) < 26:
		return ''
	t = list(s)
	c = 'z'
	i = len(s) - 1
	while i >= 0 and c >= 'a':
		if t[i] <= c:
			t[i] = c
			c = chr(ord(c) - 1)
		i -= 1
	return ''.join(t) if c < 'a' else ''
t = solve(s)
if t:
	print(t)
else:
	print(-1)


import math
from sys import stdin
string = [x for x in stdin.readline().strip()]
temp = 'a'
output = []
for i in range(len(string)):
	if string[i] <= temp:
		if temp <= 'z':
			output.append(temp)
		else:
			output.append(string[i])
		temp = chr(ord(temp) + 1)
	else:
		output.append(string[i])
if temp <= 'z':
	print(-1)
else:
	for i in output:
		print(i, end='')


s = list(input())
(i, al) = (0, 'a')
while al != chr(ord('z') + 1) and i < len(s):
	if s[i] == al:
		al = chr(ord(al) + 1)
	elif s[i] < al:
		s[i] = al
		al = chr(ord(al) + 1)
	i += 1
print(''.join(s) if al == chr(ord('z') + 1) else -1)


from __future__ import division, print_function
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)
	print(l)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans
a = 'abcdefghijklmnopqrstuvwxyz'
i = 0
s = list(si())
for j in range(len(s)):
	if s[j] <= a[i]:
		s[j] = a[i]
		i += 1
		if i == 26:
			print(''.join(s))
			break
else:
	print(-1)


def solve():
	S = input()
	counter = 97
	res = ''
	for s in list(S):
		s = ord(s)
		if counter >= 123:
			res += chr(s)
			continue
		if s <= counter:
			res += chr(counter)
			counter += 1
		else:
			res += chr(s)
	if counter == 123:
		print(res)
	else:
		print(-1)

def __starting_point():
	solve()
__starting_point()


a = list(input())
count = 0
for i in range(len(a)):
	if a[i] <= chr(ord('a') + count):
		if count == 0:
			index1 = i
		a[i] = chr(ord('a') + count)
		count += 1
	if count == 26:
		index2 = i
		print(''.join(a))
		exit()
print(-1)


from sys import stdin, stdout
s = stdin.readline().strip()
ans = list(s)
current = 0
patern = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(s)):
	if s[i] <= patern[current]:
		ans[i] = patern[current]
		current += 1
	if current == len(patern):
		stdout.write(''.join(ans))
		break
else:
	stdout.write('-1')


def main():
	(l, i) = (list(input()), 0)
	try:
		for c in 'abcdefghijklmnopqrstuvwxyz':
			while l[i] > c:
				i += 1
			l[i] = c
			i += 1
		print(''.join(l))
	except IndexError:
		print(-1)
main()


s = input()
a = list(s)
s = 97
for i in range(len(a)):
	p = ord(a[i])
	if p <= s:
		a[i] = chr(s)
		s += 1
		if s == 123:
			break
if s == 123:
	print(''.join(a))
else:
	print(-1)


s = input()
items = 'abcdefghijklmnopqrstuvwxyz0'
ans = []
for i in s:
	if items != '0' and items[0] >= i:
		ans.append(items[0])
		items = items[1:]
	else:
		ans.append(i)
if items == '0':
	print(''.join(ans))
else:
	print(-1)


A = list(input())
letter = ord('a')
for i in range(len(A)):
	if ord(A[i]) <= letter and letter != ord('z') + 1:
		A[i] = chr(letter)
		letter += 1
if letter == ord('z') + 1:
	print(''.join(A))
else:
	print(-1)


alphabet = 'abcdefghijklmnopqrstuvwxyz'
i = 0
string = list(input())
for (j, char) in enumerate(string):
	curr = alphabet[i]
	if char <= curr:
		string[j] = curr
		i += 1
	if i == 26:
		break
if i == 26:
	print(''.join(string))
else:
	print(-1)


def next_char(c):
	return chr(ord(c) + 1)
s = list(input().strip())
c = 'a'
for i in range(len(s)):
	if s[i] <= c:
		s[i] = c
		c = next_char(c)
		if ord(c) > ord('z'):
			break
if ord(c) <= ord('z'):
	print(-1)
else:
	print(*s, sep='')


s = list(input())
D = 97
C = 'a'
goon = False
for i in range(len(s)):
	if s[i] <= C:
		s[i] = C
		D += 1
	if D <= 122:
		C = chr(D)
	if D > 122:
		goon = True
		break
if goon == True:
	print(''.join(s))
else:
	print('-1')


s = input()
n = len(s)
if n < 26:
	print('-1')
else:
	ans = ''
	curr = 0
	i = 0
	while i < n:
		if ord(s[i]) <= ord('a') + curr and curr < 26:
			ans += chr(ord('a') + curr)
			curr += 1
		else:
			ans += s[i]
		i += 1
	if curr == 26:
		print(ans)
	else:
		print('-1')


x = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'
j = 0
if len(x) >= len(alphabet):
	for i in range(len(x)):
		if x[i] <= alphabet[j]:
			x = list(x)
			x[i] = alphabet[j]
			x = ''.join(x)
			j += 1
			if j == len(alphabet):
				break
	if j == len(alphabet):
		print(x)
	else:
		print(-1)
else:
	print(-1)


ALPHABET = 'abcdefghijklmnopqrstuvwxyz'

def solve(seq):
	if len(seq) < 26 or 'a' not in seq:
		return -1
	else:
		final_seq = ''
		alpha = 0
		for c in range(len(seq)):
			try:
				if seq[c] <= ALPHABET[alpha]:
					final_seq += ALPHABET[alpha]
					alpha += 1
				else:
					final_seq += seq[c]
			except IndexError:
				final_seq += seq[c:]
				break
		if alpha < 26:
			return -1
	return final_seq
seq = input()
print(solve(seq))


s = list(input())
found = False
counter = 'a'
for i in range(len(s)):
	c = s[i]
	if c <= counter:
		s[i] = counter
		counter = chr(ord(counter) + 1)
		if counter > 'z':
			print(''.join(s))
			found = True
			break
if not found:
	print(-1)


s = list(input())
c = 'a'
f = -1
for i in range(len(s)):
	if s[i] <= c:
		s[i] = c
		c = chr(ord(c) + 1)
	if c > 'z':
		f = 1
		break
if f == -1:
	print(f)
else:
	print(*s, sep='')


s = input()
l = list(s)
t = 'abcdefghijklmnopqrstuvwxyz'
i = 0
n = len(l)
impossible = False
for c in t:
	for j in range(i, n):
		if l[j] <= c:
			l[j] = c
			i = j + 1
			break
	else:
		impossible = True
if impossible:
	print(-1)
else:
	print(''.join(l))


s = input()
c = 'a'
temp = ''
for i in s:
	if ord(i) <= ord(c) and c < '{':
		temp += c
		c = chr(ord(c) + 1)
	else:
		temp += i
if c >= '{':
	print(temp)
else:
	print(-1)


s = list(input())
k = []
for i in range(len(s)):
	if s[i] == 'a' and k.count('a') == 0:
		k.append('a')
	elif k.count('a') > 0:
		if ord(s[i]) <= ord(k[-1]) + 1:
			k.append(chr(ord(k[-1]) + 1))
			s[i] = chr(ord(k[-1]))
	if ''.join(k) == 'abcdefghijklmnopqrstuvwxyz':
		break
if ''.join(k) == 'abcdefghijklmnopqrstuvwxyz':
	print(''.join(s))
else:
	print(-1)


letters = 'abcdefghijklmnopqrstuvwxyzA'
check = {}
itr = 1
for i in letters:
	check[i] = itr
	itr += 1
res = ''
st = input()
make = 0
for i in st:
	if i <= letters[make]:
		res += letters[make]
		make += 1
	else:
		res += i
if letters[make] == 'A':
	print(res)
else:
	print(-1)


str = input('')
str_len = len(str)
cur = 'a'
res = ''
for i in range(0, str_len):
	if str[i] <= cur <= 'z':
		res += cur
		cur = chr(ord(cur) + 1)
	else:
		res += str[i]
if ord(cur) != ord('z') + 1:
	print('-1')
else:
	print(res)


s = list(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
to_ind = {char: i for (i, char) in enumerate(alph)}
ind = 0
for (i, char) in enumerate(s):
	if ind == 26:
		continue
	if to_ind[char] <= ind:
		s[i] = alph[ind]
		ind += 1
if ind == 26:
	print(''.join(s))
else:
	print(-1)


x = input()
y = ''
z = ''
for i in x:
	if y == '':
		if i == 'a':
			y += 'a'
			z += y[-1]
		else:
			z += i
	elif len(y) < 26:
		if ord(i) <= ord(y[-1]) + 1:
			y += chr(ord(y[-1]) + 1)
			z += y[-1]
		else:
			z += i
	else:
		z += i
print(z if len(y) == 26 else -1)


s = list(input())
ch = 'a'
for i in range(len(s)):
	if s[i] <= ch:
		s[i] = ch
		if ch == 'z':
			ans = ''
			for i in range(len(s)):
				ans += s[i]
			print(ans)
			break
		ch = chr(ord(ch) + 1)
else:
	print(-1)


s = list(input())
k = 97
for i in range(len(s)):
	if k == 123:
		break
	if chr(k) >= s[i]:
		s[i] = chr(k)
		k += 1
if k == 123:
	print(*s, sep='')
else:
	print(-1)


sequence = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
st = list(input())
ind = 0
for i in range(len(st)):
	if st[i] <= sequence[ind]:
		st[i] = sequence[ind]
		ind += 1
	if ind == 26:
		break
if ind == 26:
	print(''.join(st))
else:
	print(-1)


from string import ascii_lowercase as alphabet

def transform(string):
	string_builder = list(string)
	needed = 0
	for i in range(len(string)):
		if string[i] <= alphabet[needed]:
			string_builder[i] = alphabet[needed]
			needed += 1
		if needed == len(alphabet):
			break
	if needed == len(alphabet):
		return ''.join(string_builder)
	else:
		return -1
print(transform(input()))


a = input()
n = len(a)
j = 0
c = ''
chek = False
b = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
	if a[i] <= b[j] and chek == False:
		c += b[j]
		j += 1
	else:
		c += a[i]
	if j == 26:
		j = 25
		chek = True
if chek:
	print(c)
else:
	print(-1)


s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
if len(s) < len(a):
	print(-1)
	exit(0)
p = 0
f = False
for i in s:
	if p < len(a) and i <= a[p]:
		ans += a[p]
		p += 1
		if p == len(a):
			f = True
	else:
		ans += i
print(ans if f else '-1')


s = input()
o = ''
c = ord('a')
f = False
for i in s:
	if ord(i) <= c <= ord('z'):
		o += chr(c)
		c += 1
	else:
		o += i
if c <= ord('z'):
	o = -1
print(o)


s = input()
abc = 'abcdefghijklmnopqrstuvwxyz'
sub_indexes = []
s_len = len(s)
abc_len = len(abc)
answer = -1
abc_cnt = 0
match_flag = False
if s_len >= abc_len:
	for sub_char_cnt in range(s_len):
		if s[sub_char_cnt] in abc[:len(sub_indexes) + 1]:
			sub_indexes.append(sub_char_cnt)
		if abc_len == len(sub_indexes):
			match_flag = True
			break
	if match_flag == True:
		answer = s[:sub_indexes[0]] + abc[0]
		for abc_cnt in range(abc_len - 1):
			answer += s[sub_indexes[abc_cnt] + 1:sub_indexes[abc_cnt + 1]] + abc[abc_cnt + 1]
		answer += s[sub_indexes[abc_len - 1] + 1:]
print(answer)


a = list(input())
ans = ['a']
current = 1
anst = ''
for i in range(len(a)):
	if a[i] in ans:
		ans += [chr(current + 97)]
		anst += chr(current + 96)
		current += 1
	else:
		anst += a[i]
	if current > 26:
		print(anst + ''.join(a[i + 1:]))
		quit()
print(-1)


s = input()
count = 0
min_ord = 96
ord_list = [ord(c) for c in s]
for (i, sym) in enumerate(ord_list):
	if count == 26:
		break
	if sym <= min_ord + 1:
		ord_list[i] = min_ord + 1
		min_ord += 1
		count += 1
if count != 26:
	print(-1)
else:
	print(''.join((chr(c) for c in ord_list)))


line = list(input())
alf = list('abcdefghijklmnopqrstuvwxyz')
answ = 0
for i in range(len(line) - 1, -1, -1):
	if ord(line[i]) <= ord(alf[len(alf) - 1 - answ]):
		line[i] = alf[len(alf) - 1 - answ]
		answ += 1
	if answ == 26:
		break
if answ == 26:
	print(*line, sep='')
else:
	print(-1)


import math
import queue
s = input()
n = len(s)
a = [s[i] for i in range(0, n)]
current = 0
letter = chr(ord('a') - 1)
for i in range(0, n):
	if ord(a[i]) - ord(letter) > 1:
		continue
	else:
		a[i] = chr(ord(letter) + 1)
		letter = a[i]
		if letter == 'z':
			break
if letter == 'z':
	for i in range(0, n):
		print(a[i], end='')
else:
	print(-1)


s = input()
d = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
f = {0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f', 6: 'g', 7: 'h', 8: 'i', 9: 'j', 10: 'k', 11: 'l', 12: 'm', 13: 'n', 14: 'o', 15: 'p', 16: 'q', 17: 'r', 18: 's', 19: 't', 20: 'u', 21: 'v', 22: 'w', 23: 'x', 24: 'y', 25: 'z'}
p = []
for i in s:
	p.append(d[i])
l = 0
for i in range(len(p)):
	if l >= 26:
		break
	if p[i] <= l:
		p[i] = l
		l += 1
if l == 26:
	stoka = ''
	for i in range(len(p)):
		stoka += f[p[i]]
	print(stoka)
else:
	print(-1)


s = input()
if len(s) < 26:
	print(-1)
else:
	temp = list(s)
	if min(temp) != 'a':
		print(-1)
	else:
		req = [chr(i) for i in range(ord('a'), ord('z') + 1)]
		j = 0
		for i in range(0, len(s)):
			if ord(temp[i]) <= ord(req[j]):
				temp[i] = req[j]
				j += 1
				if j == 26:
					break
		if j == 26:
			print(''.join(temp))
		else:
			print(-1)


def solve(s):
	if len(s) < 26:
		return -1
	n = len(s)
	lis = list('abcdefghijklmnopqrstuvwxyz')
	curr = 0
	for i in range(n):
		if lis.index(s[i]) <= curr:
			s[i] = lis[curr]
			curr += 1
		if curr == 26:
			break
	if curr == 26:
		return ''.join(s)
	return -1
s = list(input())
print(solve(s))


def solve(stg):
	check = False
	stg = list(stg)
	x = 'a'
	for i in range(len(stg)):
		if stg[i] <= x:
			stg[i] = x
			x = chr(ord(x) + 1)
			if x > 'z':
				check = True
				break
	if check:
		stg = ''.join(stg)
		return stg
	return -1

def string_transformation(stg):
	return solve(stg)
stg = input()
print(string_transformation(stg))


s = input()
curr = 0
poss = 1
l = []
for i in s:
	if ord(i) <= 97 + curr and curr < 26:
		l.append(chr(97 + curr))
		curr += 1
	else:
		l.append(i)
if curr == 26:
	for i in l:
		print(i, end='')
else:
	print(-1)


q = 'abcdefghijklmnopqrstuvwxyz'
s = input()
if len(s) < 26:
	print(-1)
	exit()
qptr = 0
t = []
for i in s:
	if qptr < 26:
		if i <= q[qptr]:
			t.append(q[qptr])
			qptr += 1
		else:
			t.append(i)
	else:
		t.append(i)
if qptr != len(q):
	print(-1)
	exit()
else:
	for i in t:
		print(i, sep='', end='')
print()


s = list(input())
if len(s) < 26:
	print(-1)
	exit()
alpha = 'abcdefghijklmnopqrstuvwxyz'
cidx = 0
for i in range(len(s)):
	if s[i] <= alpha[cidx]:
		s[i] = alpha[cidx]
		cidx += 1
	if cidx == 26:
		print(''.join(s))
		exit()
else:
	print(-1)


def evolution(s):
	(t, c) = ('', ord('a'))
	for elem in s:
		if ord(elem) <= c <= ord('z'):
			t += chr(c)
			c += 1
		else:
			t += elem
	if c <= ord('z'):
		t = -1
	return t
print(evolution(input()))


s = input()
score = 0
if len(s) < 26:
	print(-1)
else:
	done = 0
	ok = 0
	ans = ''
	for i in range(len(s)):
		if s[i] <= chr(done + ord('a')):
			ans += chr(done + ord('a'))
			done += 1
		else:
			ans += s[i]
		if done == 26:
			ok = 1
		done %= 26
	if not ok:
		print(-1)
	else:
		print(ans)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 15
mod = 10 ** 9 + 7

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	s = [c for c in S()]
	t = string.ascii_lowercase
	ti = 0
	for i in range(len(s)):
		if t[ti] >= s[i]:
			s[i] = t[ti]
			ti += 1
			if ti == 26:
				return ''.join(s)
	return -1
print(main())


text = list(input())
cnt = 0
d = 1
for i in range(len(text)):
	if ord(text[i]) - 96 <= d:
		text[i] = chr(d + 96)
		d += 1
		if d == 27:
			break
if d == 27:
	print(''.join(text))
else:
	print(-1)


s = input()
arr = []
for i in s:
	arr.append(i)
c = 'a'
d = 0
for i in range(len(arr)):
	if arr[i] <= c:
		arr[i] = c
		if c == 'z':
			d = 1
			break
		c = chr(ord(c) + 1)
if d == 0:
	print(-1)
else:
	print(*arr, sep='')


import sys
s = list(input())
if len(s) < 26:
	print(-1)
	sys.exit()
al = list('abcdefghijklmnopqrstuvwxyz')
i = 0
for j in range(len(s)):
	c = s[j]
	if ord(c) <= ord(al[i]):
		s[j] = al[i]
		i += 1
		if i == 26:
			break
if i >= 26:
	print(''.join(s))
else:
	print(-1)


s = input()
t = ''
cur = 0
for i in range(len(s)):
	if cur < 26 and ord(s[i]) <= 97 + cur:
		t += chr(97 + cur)
		cur += 1
	else:
		t += s[i]
if cur < 26:
	print(-1)
else:
	print(t)


s = list(input())
i = 97
for j in range(len(s)):
	x = s[j]
	if x <= chr(i):
		s[j] = chr(i)
		i += 1
	if i == 123:
		print(''.join(s))
		exit()
print(-1)


s = list(input())
if len(s) < 26:
	print(-1)
else:
	m = 'abcdefghijklmnopqrstuvwxyz'
	c = 0
	for i in range(len(s)):
		if c == 26:
			break
		if m[c] >= s[i]:
			s[i] = m[c]
			c += 1
	if c == 26:
		print(''.join(s))
	else:
		print(-1)


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
st = 'abcdefghijklmnopqrstuvwxyz#'
c = 0
s = ls()
for i in range(len(s)):
	if s[i] == st[c]:
		c += 1
	elif ord(st[c]) - ord(s[i]) >= 1:
		s[i] = st[c]
		c += 1
if c == 26:
	print(''.join(s))
else:
	print(-1)


import sys
s = sys.stdin.readline().strip()
alph = 'abcdefghijklmnopqrstuvwxyz'
res = []
ia = 0
done = False
for (i, c) in enumerate(s):
	if c <= alph[ia]:
		res.append(alph[ia])
		ia += 1
		if ia == len(alph):
			done = True
			idone = i
			break
	else:
		res.append(c)
if done:
	print(''.join(res) + s[idone + 1:])
else:
	print('-1')


x = 'abcdefghijklmnopqrstuvwxyz'
y = str(input())
yLista = list(y)
k = 0
t = 0
if len(x) > len(y):
	k = 1
else:
	for i in range(len(y)):
		if t >= 26:
			continue
		if x[t] == yLista[i]:
			t = t + 1
			continue
		if x[t] >= yLista[i]:
			yLista[i] = x[t]
			t = t + 1
pos = 0
for i in range(len(y)):
	if yLista[i] == x[pos]:
		pos = pos + 1
	if pos == 26:
		break
if pos != 26:
	k = 1
y = ''.join(yLista)
if k == 0 and t == len(x):
	print(y)
else:
	print(-1)


s = input()
newst = []
curr = 'a'
for k in s:
	if curr >= k and curr <= 'z':
		newst.append(curr)
		curr = chr(ord(curr) + 1)
	else:
		newst.append(k)
if curr > 'z':
	for k in newst:
		print(k, end='')
	print()
else:
	print(-1)


s = input()
k = 0
n = 97
a = []
for i in s:
	a.append(i)
for i in range(len(s)):
	if ord(a[i]) <= n:
		a[i] = chr(n)
		n += 1
		k += 1
	if k == 26:
		break
if k < 26:
	print(-1)
else:
	print(*a, sep='')


import math
s = list(input())
if len(s) < 26:
	print(-1)
	exit()
c = 0
for i in range(len(s)):
	if ord(s[i]) <= 97 + c:
		s[i] = chr(97 + c)
		c += 1
	if c == 26:
		print(''.join(s))
		exit()
print(-1)


s = input()
n = len(s)
L = list(s)
S = 'abcdefghijklmnopqrstuvwxyz'
ind = 0
for i in range(n):
	if ind < 26 and s[i] <= S[ind]:
		L[i] = S[ind]
		ind += 1
ans = ''
for item in L:
	ans += item
if ind >= 26:
	print(ans)
else:
	print(-1)


s = input()
t = 'abcdefghijklmnopqrstuvwxyz'
c = 0
flag = 0
answer = []
for i in s:
	if flag == 0:
		if i <= t[c]:
			c += 1
			answer.append(t[c - 1])
		else:
			answer.append(i)
	else:
		answer.append(i)
	if c >= 26:
		flag = 1
if flag == 1:
	print(''.join(answer))
else:
	print(-1)


S = input()
Str = list(S)
l = len(S)
pos = 0
for i in range(l):
	if ord(Str[i]) - ord('a') > pos:
		continue
	Str[i] = chr(ord('a') + pos)
	pos = pos + 1
	if pos == 26:
		break
if pos == 26:
	print(''.join(Str))
else:
	print(-1)


s = input()
n = len(s)
if n < 26:
	ans = -1
else:
	now = 'a'
	ans = ''
	for i in range(n):
		if s[i] <= now:
			ans += now
			if now == 'z':
				now = '_'
			now = chr(ord(now) + 1)
		else:
			ans += s[i]
	if now != chr(ord('z') + 1) and now != '`':
		ans = -1
print(ans)


s = input()
res = ''
tmp = chr(ord('a') - 1)
b = False
for i in s:
	if i <= chr(ord(tmp) + 1):
		tmp = chr(ord(tmp) + 1)
		res += tmp
	else:
		res += i
	if tmp == 'z':
		b = True
		break
res += s[len(res):]
print(['-1', res][b])


from sys import stdin, stdout

def main():
	s = stdin.readline()
	n = len(s) - 1
	ans = []
	curr = 0
	for i in range(n):
		if curr < 26:
			if ord(s[i]) - ord('a') <= curr:
				ans.append(chr(curr + ord('a')))
				curr += 1
			else:
				ans.append(s[i])
		else:
			ans.append(s[i])
	if curr < 26:
		stdout.write('-1\n')
	else:
		stdout.write(''.join(ans))
		stdout.write('\n')
main()


arr = 'abcdefghijklmnopqrstuvwxyz'
a = input()
b = ''
i = 0
let = 0
while i < int(len(a)):
	if let < len(arr) and ord(a[i]) <= ord(arr[let]):
		b = b + arr[let]
		let = let + 1
	else:
		b = b + a[i]
	i = i + 1
if let == 26:
	print(b)
else:
	print(-1)


ans = 'abcdefghijklmnopqrstuvwxyz'
s = input()
i = 0
t = ''
for c in s:
	if i < 26:
		if c <= ans[i]:
			t += ans[i]
			i += 1
		else:
			t += c
	else:
		t += c
print(('-1', t)[i == 26])


i = 97
j = 0
s = [x for x in input()]
for item in s:
	if item <= chr(i):
		s[j] = chr(i)
		i += 1
	if i > 122:
		print(''.join(s))
		break
	j += 1
else:
	print(-1)


s = input()

def aln(c):
	return ord(c) - ord('A') - 31

def nal(n):
	return chr(n + 96)
a = []
for i in range(len(s)):
	a.append(aln(s[i]))
tar = 1
for i in range(len(s)):
	if a[i] != tar and a[i] < tar:
		a[i] = tar
		tar = tar + 1
	if a[i] == tar:
		tar = tar + 1
	if tar == 27:
		break
if tar == 27:
	ans = ''
	for i in range(len(s)):
		ans += nal(a[i])
	print(ans)
else:
	print(-1)


import bisect
import collections
import copy
import enum
import functools
import heapq
import itertools
import math
import random
import re
import sys
import time
import string
from typing import List, Mapping
sys.setrecursionlimit(999999)
s = list(input())
t = string.ascii_lowercase
it = 0
for (i, c) in enumerate(s):
	if c <= t[it]:
		s[i] = t[it]
		it += 1
		if it == 26:
			print(''.join(s))
			exit()
print(-1)


s = list(input())
miss = 'a'
j = 0
for i in s:
	if i <= miss:
		s[j] = miss
		miss = chr(ord(miss) + 1)
		if ord(miss) > 122:
			print(''.join(s))
			break
	j += 1
else:
	print(-1)


s = input()
(L, i) = (len(s), 0)
for ch in 'abcdefghijklmnopqrstuvwxyz':
	while i < L and ch < s[i]:
		i += 1
	if i == L:
		print(-1)
		break
	(s, i) = (s[:i] + ch + s[i + 1:], i + 1)
else:
	print(s)


import sys
import math
from collections import defaultdict
s = list(sys.stdin.readline()[:-1])
cur = 97
n = len(s)
ans = True
for i in range(n):
	if ord(s[i]) <= cur:
		s[i] = chr(cur)
		cur += 1
		if cur == 123:
			break
if cur == 123:
	print(''.join((x for x in s)))
else:
	print(-1)


import string
alf = string.ascii_lowercase
count = 0
s = list(input())
for (i, el) in enumerate(s):
	if alf.index(el) <= count:
		s[i] = alf[count]
		count += 1
		if count == 26:
			print(''.join(s))
			exit(0)
print(-1)


s = input()
s1 = []
for l in s:
	s1.append(ord(l) - 97)
letter = 0
s_new = []
check = False
for i in range(len(s1)):
	if s1[i] <= letter and (not check):
		s_new.append(letter)
		letter += 1
	else:
		s_new.append(s1[i])
	if letter == 26:
		check = True
if not check:
	print(-1)
else:
	for i in range(len(s1)):
		print(chr(s_new[i] + 97), end='')
	print()


def string(st):
	if len(st) < 26:
		return False
	start = 97
	for i in range(len(st)):
		if ord(st[i]) <= start:
			st[i] = chr(start)
			start += 1
		if start > 122:
			break
	if start <= 122:
		return False
	else:
		return True
s = list(input())
if string(s):
	k = [print(x, end='') for x in s]
else:
	print(-1)


s = input()
n = len(s)
q = [0] * n
for i in range(n):
	q[i] = ord(s[i]) - 97
k = 0
f = []
g = 0
for i in range(n):
	if q[i] in range(k + 1):
		k += 1
		f.append(i)
	if k == 26:
		g = 1
		break
if g:
	k = 0
	for i in f:
		q[i] = k
		k += 1
	for i in range(n):
		print(chr(q[i] + 97), end='')
else:
	print(-1)


alf = list(input())
n = len(alf)
if n < 26:
	print(-1)
else:
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	m = 0
	for i in range(n):
		if alf[i] <= alphabet[m]:
			alf[i] = alphabet[m]
			m += 1
			if m == 26:
				print(''.join(alf))
				break
		elif n - (i + 1) < 26 - (m + 1):
			break
	if m < 26:
		print(-1)


from string import ascii_lowercase as alphabet
cur_idx = 0
given_string = input()
if len(given_string) < 26:
	print(-1)
else:
	result = []
	for c in given_string:
		if cur_idx >= 26:
			result.append(c)
		elif c > alphabet[cur_idx]:
			result.append(c)
			continue
		else:
			result.append(alphabet[cur_idx])
			cur_idx += 1
	if cur_idx >= 26:
		print(''.join(result))
	else:
		print(-1)


ans = list(input())
idx = 0
for i in range(len(ans)):
	if ord(ans[i]) % 97 <= idx:
		ans[i] = chr(97 + idx)
		idx += 1
	if idx == 26:
		break
print(''.join(ans) if idx == 26 else -1)


s = input()
length = len(s)
S = list(s)
pos = 0
current = ord('a')
while pos < length and current <= ord('z'):
	val = ord(S[pos])
	if val == current:
		current += 1
	elif val < current:
		S[pos] = chr(current)
		current += 1
	pos += 1
if current > ord('z'):
	print(''.join(S))
else:
	print('-1')


given_string = list(input())
current = 'a'
j = 0
for i in range(len(given_string)):
	if given_string[i] <= current:
		given_string[i] = current
		current = chr(ord(current) + 1)
		if current > 'z':
			break
if current == chr(ord('a') + 26):
	toreturn = ''.join(given_string)
	print(toreturn)
else:
	print(-1)


s = str(input())
current = ord('a')
n = len(s)
ans = ''
for i in range(n):
	if ord(s[i]) <= current and current < 123:
		ans += chr(current)
		current += 1
	else:
		ans += s[i]
if current == 123:
	print(ans)
else:
	print(-1)


str = input()
if len(str) < 26:
	print(-1)
	exit()
(cnt, s) = (0, '')
for ch in str:
	if cnt < 26 and ord(ch) <= cnt + ord('a'):
		s += chr(ord('a') + cnt)
		cnt += 1
	else:
		s += ch
print(s if cnt == 26 else -1)


s = input().strip()
n = len(s)
tail = [-1] * 26
f = [0] * n
for i in range(n):
	if s[i] == 'a':
		f[i] = 1
	else:
		f[i] = -int(1000000000.0)
for i in range(n):
	x = ord(s[i]) - ord('a')
	for j in range(26):
		if tail[j] != -1 and x <= f[tail[j]]:
			f[i] = max(f[i], f[tail[j]] + 1)
	tail[x] = i
ok = False
for i in range(n):
	if f[i] >= 26:
		ok = True
		break
if not ok:
	print('-1')
	exit(0)
res = list(s)
len = 1
for i in range(n):
	if len > 26:
		break
	if f[i] == len:
		res[i] = chr(len - 1 + ord('a'))
		len += 1
print(''.join(map(str, res)))


a = list('abcdefghijklmnopqrstuvwxyz')
s = list(input())
i = 0
j = 0
cou = 0
while i < len(s) and j < len(a):
	if s[i] <= a[j]:
		cou += 1
		s[i] = a[j]
		i += 1
		j += 1
	else:
		i += 1
if cou == 26:
	print(*s, sep='')
else:
	print(-1)


s = input()
if len(s) < 26:
	print(-1)
else:
	t = ''
	j = 26
	ans = 0
	n = len(s)
	for i in range(n - 1, -1, -1):
		if ord(s[i]) - 97 < j:
			j -= 1
			t += chr(97 + j)
			if j <= 0:
				ans = 1
				break
		else:
			t += s[i]
	if ans == 0:
		print(-1)
	else:
		tt = s[:i]
		n = len(t)
		for i in range(n - 1, -1, -1):
			tt += t[i]
		print(tt)


s = input()
n = len(s)
orda = ord('a')
L = [ord(i) - orda for i in s]
f = True
x = 0
for i in range(n):
	if x == 26:
		f = False
		break
	if x >= L[i]:
		L[i] = x
		x += 1
if f and x != 26:
	print(-1)
else:
	for i in L:
		print(chr(i + orda), end='')
	print()


stri = list(input())
ch = 'a'
for i in range(len(stri)):
	if ch >= stri[i]:
		stri[i] = ch
		ch = chr(ord(ch) + 1)
		if stri[i] == 'z':
			break
if ord(ch) == 123:
	print(''.join(stri))
else:
	print(-1)


s = list(input())
d = {}
x = list('qwertyuiopasdfghjklzxcvbnm')
x.sort()
j = 0
for i in range(len(s)):
	if s[i] <= x[j]:
		s[i] = x[j]
		j += 1
	if j == 26:
		break
if j == 26:
	print(''.join(s))
else:
	print(-1)


line = input()
s = line.strip()
raw = 'abcdefghijklmnopqrstuvwxyz'
results = []
if len(s) < 26:
	print(-1)
else:
	ind = 0
	for i in range(len(s)):
		if ind >= 26:
			results.append(s[i])
		elif ord(s[i]) <= ord(raw[ind]):
			results.append(raw[ind])
			ind += 1
		else:
			results.append(s[i])
	if ind >= 26:
		print(''.join(results))
	else:
		print(-1)


def run():
	n = input()
	seq = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	seq = ''.join(seq)
	not_seen = 0
	new_seq = ''
	for i in range(len(n)):
		if n[i] in seq[:not_seen + 1]:
			new_seq += seq[not_seen]
			not_seen += 1
		else:
			new_seq += n[i]
		if not_seen == 26:
			break
	if not_seen < 26:
		print(-1)
	else:
		print(new_seq + n[i + 1:])
run()


import sys
s = list(input())
cc = 97
for i in range(len(s)):
	if cc >= ord(s[i]):
		s[i] = chr(cc)
		cc += 1
	if cc > 122:
		print(''.join(s))
		break
else:
	print(-1)


s = input()
string = ''
k = ord('a')
for x in s:
	if ord(x) <= k:
		string = string + chr(k)
		k = min(ord('z'), k + 1)
	else:
		string = string + x
if k == ord('z') and string[-1] == 'z':
	print(string)
else:
	print(-1)


(i, final_str, ans, s) = (0, '', 'abcdefghijklmnopqrstuvwxyz', input())
for ch in s:
	if i < 26:
		if ch <= ans[i]:
			final_str += ans[i]
			i += 1
		else:
			final_str += ch
	else:
		final_str += ch
print(('-1', final_str)[i == 26])


t = input()
d = 'abcdefghijklmnopqrstuvwxyz'
length = len(t)
w = list(t)
count = 0
match = 0
if length < 26:
	print(-1)
else:
	j = 0
	for i in range(length):
		if w[i] <= d[j]:
			w[i] = d[j]
			j = j + 1
		if j == 26:
			break
	if j == 26:
		print(''.join(w))
	else:
		print(-1)


s = list(input(''))
n = len(s)
if n < 26:
	print(-1)
else:
	flag = 1
	pos = -1
	for j in range(n):
		if s[j] == 'a':
			pos = j
			break
	ans = 'abcdefghijklmnopqrstuvwxyz'
	if n - pos < 24:
		print(-1)
	else:
		j = 0
		cnt = 0
		for i in range(pos, n):
			if s[i] <= ans[j]:
				s[i] = ans[j]
				cnt += 1
				j += 1
			if cnt == 26:
				break
		if cnt < 26:
			print(-1)
		else:
			print(''.join(s))


s = input()
t = ''
c = ord('a')
for i in s:
	if ord(i) <= c <= ord('z'):
		t += chr(c)
		c += 1
	else:
		t += i
if c <= ord('z'):
	t = -1
print(t)


def main():
	string = [x for x in input().strip()]
	counter = ord('a')
	for i in range(len(string)):
		if ord(string[i]) <= counter:
			string[i] = chr(counter)
			counter += 1
			if counter > ord('z'):
				break
	if counter > ord('z'):
		print(''.join(string))
	else:
		print('-1')
main()


s = list(input())
a = 'abcdefghijklmnopqrstuvwxyz'
i = 0
j = 0
while i < len(a) and j < len(s):
	if s[j] <= a[i]:
		s[j] = a[i]
		i += 1
	j += 1
if i == len(a):
	print(''.join(s))
else:
	print(-1)


a = input()
a = list(a)
b = len(a)
c = 0
final = []
if b < 26:
	print('-1')
else:
	j = 0
	sum1 = 0
	for i in range(len(a)):
		if ord(a[i]) <= ord('a') + j:
			a[i] = chr(ord('a') + j)
			sum1 += 1
			j = j + 1
		if sum1 == 26:
			break
	if sum1 == 26:
		print(''.join(a))
	else:
		print('-1')


ord1 = 97
smth = input()
s = []
kolvo = 0
for i in range(len(smth)):
	s.append(smth[i])
for i in range(len(s)):
	if ord(s[i]) <= ord1:
		s[i] = chr(ord1)
		ord1 += 1
		kolvo += 1
	if kolvo == 26:
		break
if kolvo < 26:
	print(-1)
else:
	for i in range(len(s)):
		print(s[i], end='')


def check(a, b):
	if ord(a) <= ord(b):
		return 1
	return 0

def find(a):
	n = len(a)
	if n < 26:
		return -1
	r = list('abcdefghijklmnopqrstuvwxyz')
	j = 0
	cur = r[j]
	for i in range(n):
		if check(a[i], cur):
			a[i] = cur
			j += 1
			if j == 26:
				break
			cur = r[j]
	if j == 26:
		return ''.join(a)
	return -1
a = list(input())
ans = find(a)
print(ans)


s = input()
if 'abcdefghijklmnopqrstuvwxyz' in s:
	print(s)
	exit()
pos = s.find('a')
if pos == -1:
	print(-1)
	exit()
ord_a = ord('a')
s_list = list(s)
offset = 1
for i in range(pos + 1, len(s)):
	val = chr(ord_a + offset)
	if s[i] <= val:
		if s[i] < val:
			s_list[i] = val
		offset += 1
		if offset == 26:
			break
print(''.join(s_list) if offset == 26 else -1)


s = input()
ans = s + ''
l = len(s)
a = 'abcdefghijklmnopqrstuvwxyz'
i = 0
for j in range(26):
	while s[i] > a[j]:
		i += 1
		if i == l:
			print(-1)
			return
	ans = ans[:i] + a[j] + ans[i + 1:]
	i += 1
	if j != 25 and i == l:
		print(-1)
		return
print(ans)


s = list(input())
(n, m) = (ord('a'), 0)
for i in range(len(s)):
	if s[i] <= chr(n):
		s[m] = chr(n)
		n += 1
	if n > ord('z'):
		break
	m += 1
if n > ord('z'):
	for i in s:
		print(i, end='')
else:
	print(-1)


s = iter(input())
c2 = next(s)
res = c2
try:
	for c in map(chr, range(ord('a'), 1 + ord('z'))):
		while c < c2:
			c2 = next(s)
			res += c2
		(res, c2) = (res[:-1] + c, '{')
	res += ''.join(s)
except StopIteration:
	res = '-1'
print(res)


s = list(input())
initial_ord = ord('a')
final_ord = ord('z')
curr_ord = ord('a')
index = 0
while index < len(s):
	if ord(s[index]) <= curr_ord:
		s[index] = chr(curr_ord)
		curr_ord += 1
	index += 1
	if curr_ord == final_ord + 1:
		break
if curr_ord == final_ord + 1:
	print(''.join(s))
else:
	print(-1)


intput = lambda : map(int, input().split())
s = list(input())
curr = 'a'
for (i, c) in enumerate(s):
	if c <= curr:
		s[i] = curr
		curr = chr(ord(curr) + 1)
		if curr > 'z':
			break
if curr > 'z':
	print(''.join(s))
else:
	print(-1)


q = [str(x) for x in input()]
start = ord('a')
for i in range(len(q)):
	t = q[i]
	if ord(t) <= start:
		q[i] = chr(start)
		start += 1
	if start == ord('z') + 1:
		break
print(''.join(q) if start == ord('z') + 1 else -1)


s = input()
if len(s) < 26:
	print(-1)
else:
	abc = ''.join([f'{chr(i)}' for i in range(ord('a'), ord('z') + 1)])
	ind = 0
	r = ''
	for i in s:
		if ind <= 25 and i <= abc[ind]:
			r += abc[ind]
			ind += 1
		else:
			r += i
	if ind == 26:
		print(r)
	else:
		print(-1)


s = list(input())
menor = 'a'
aux = s[:]
achou = False
for i in range(len(s)):
	if aux[i] <= menor:
		aux[i] = menor
		if ord(menor) >= ord('z'):
			achou = True
			break
		else:
			menor = chr(ord(menor) + 1)
if achou:
	print(''.join(aux))
else:
	print(-1)


import sys

def cal(s):
	k = ''
	x = 0
	p = 0
	if len(s) < 26:
		return -1
	else:
		for i in s:
			if ord(i) - ord('a') <= x:
				k = k + chr(ord('a') + x)
				x += 1
			else:
				k = k + i
			if x > 25:
				break
			p += 1
		if x < 26:
			return -1
		else:
			return k + s[p + 1:]
	return -1

def main():
	s = input()
	x = cal(s)
	print(x)
	return
main()


t = 'abcdefghijklmnopqrstuvwxyz'
i = 0
s = list(input())
for j in range(len(s)):
	if s[j] <= t[i]:
		s[j] = t[i]
		i += 1
		if i == 26:
			print(*s, sep='')
			break
else:
	print(-1)


alpha = input()
elem = 'a'
count = 1
ind = alpha.find('a')
res = alpha[:ind + 1]
if ind == -1:
	print(-1)
else:
	alpha = alpha[ind + 1:]
	for (indx, i) in enumerate(alpha):
		if ord(i) <= ord(elem) + 1:
			count += 1
			elem = chr(ord(elem) + 1)
			res += elem
		else:
			res += i
		if count == 26:
			res += alpha[indx + 1:]
			break
	if count == 26:
		print(res)
	else:
		print(-1)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	s = si()
	n = len(s)
	ans = ''
	p = 0
	for i in range(n):
		if p == 26:
			ans += s[i]
			continue
		if abd[s[i]] <= p:
			ans += abc[p]
			p += 1
		else:
			ans += s[i]
	if p == 26:
		print(ans)
	else:
		print(-1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


s = list(input())
n = len(s)
c = 97
ans = 'NO'
for i in range(n):
	if ord(s[i]) <= c:
		s[i] = chr(c)
		c = c + 1
		if c == 122 and i != n - 1:
			s[i + 1] = 'z'
			print(''.join(s))
			ans = 'YES'
			break
if ans != 'YES':
	print(-1)


a = list(input())
now = ord('a')
fail = False
for i in range(len(a)):
	if ord(a[i]) <= now:
		a[i] = chr(now)
		if now == ord('z'):
			break
		now += 1
else:
	fail = True
if fail:
	print('-1')
else:
	for c in a:
		print(c, end='')
	print('')


ascii_lower = 'abcdefghijklmnopqrstuvwxyz'
s = list(input())
chars = []
i = 0
for j in range(len(s)):
	if s[j] <= ascii_lower[i]:
		i += 1
		chars.append(j)
	if i == 26:
		break
if i == 26:
	for j in range(26):
		s[chars[j]] = ascii_lower[j]
	print(''.join(s))
else:
	print(-1)


import string

def bad():
	print(-1)
	exit()
s = input()
if len(s) < 26:
	bad()
f = 'a'
ans = list()
c = 0
for_ans = string.ascii_lowercase
j = len(s)
for (i, el) in enumerate(s):
	if el <= f:
		ans.append(f)
		c += 1
		if c == 26:
			j = i + 1
			break
		f = for_ans[c]
	else:
		ans.append(el)
if c < 26:
	bad()
print(''.join(ans) + s[j:])


import sys
import os
import math
import re
chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
a = list(input())
if len(a) < 26:
	print('-1')
	exit(0)
m = 0
for i in range(len(a)):
	if a[i] <= chars[m]:
		a[i] = chars[m]
		m += 1
	if m > 25:
		print(''.join(a))
		exit(0)
	if len(a) - i - 1 < 26 - m:
		print('-1')
		exit(0)
if m < 25:
	print('-1')
	exit(0)
print(''.join(a))


def main():
	s = list(input())
	curr = ord('a')
	for i in range(len(s)):
		if ord(s[i]) <= curr and curr <= ord('z'):
			s[i] = chr(curr)
			curr += 1
	if curr <= ord('z'):
		print(-1)
		return
	new = ''
	for i in s:
		new += i
	print(new)
main()


(s, a, b, c) = (input(), 'abcdefghijklmnopqrstuvwxyz', '', 0)
for i in range(len(s)):
	if c == 26:
		b += s[i]
	elif a.index(s[i]) <= c:
		b += a[c]
		c += 1
	else:
		b += s[i]
if c == 26:
	print(b)
else:
	print(-1)


s = [k for k in input()]
t = 0
for i in range(97, 123):
	if s == ['-1'] or t == len(s):
		s = ['-1']
		break
	for j in range(t, len(s)):
		if ord(s[j]) <= i:
			s[j] = chr(i)
			t = j + 1
			break
		elif j == len(s) - 1:
			s = ['-1']
			break
print(''.join(s))


from string import ascii_lowercase
ls = []
s = input()
i = 0
j = 0
while i < len(s):
	if s[i] > ascii_lowercase[j]:
		ls.append(s[i])
	else:
		ls.append(ascii_lowercase[j])
		j += 1
		if j == len(ascii_lowercase):
			break
	i += 1
if i == len(s):
	print(-1)
else:
	print(''.join(ls) + s[i + 1:])


s = input()
t = 97
o = ''
for i in s:
	if ord(i) <= t and t <= 122:
		o += chr(t)
		t += 1
	else:
		o += i
if t != 123:
	print(-1)
else:
	print(o)


s = input()
if len(s) < 26:
	print(-1)
else:
	ans = -1
	i = 0
	pos = 0
	while pos < len(s) and i < 26:
		if ord(s[pos]) <= ord('a') + i:
			s = s[:pos] + chr(ord('a') + i) + s[pos + 1:]
			i += 1
		pos += 1
	if i == 26:
		print(s)
	else:
		print(-1)


def transformString(s):
	chrc = 'a'
	if len(s) < 26:
		return -1
	for i in range(0, len(s)):
		if ord(chrc) > ord('z'):
			break
		if s[i] <= chrc:
			s[i] = chrc
			chrc = chr(ord(chrc) + 1)
	if chrc <= 'z':
		return -1
	return ''.join(s)
s = list(input())
print(transformString(s))


def main():
	s = list(input())
	alpha = 'a'
	for i in range(len(s)):
		if s[i] <= alpha:
			s[i] = alpha
			alpha = chr(ord(alpha) + 1)
		if alpha > 'z':
			break
	if alpha > 'z':
		print(''.join(s))
	else:
		print(-1)
main()


arr = list(input())
entry = 'a'
cnt = 0
for i in range(len(arr)):
	if arr[i] <= entry:
		arr[i] = entry
		entry = chr(ord(entry) + 1)
		cnt += 1
	if cnt == 26:
		break
print(''.join(arr) if cnt == 26 else -1)


from os import path
from io import BytesIO, IOBase
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, Counter, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def ceil(a, b):
	return (a + b - 1) // b

def solve():
	s = list(si())
	c = 0
	for i in range(len(s)):
		if bo(s[i]) == c:
			c += 1
		elif bo(s[i]) <= c:
			s[i] = chr(97 + c)
			c += 1
		if c == 26:
			break
	if c == 26:
		print(''.join(s))
	else:
		print(-1)
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
s = STR()
if len(s) < 26:
	print('-1')
	exit(0)
n = len(s)
c = 'a'
flag = False
for i in range(n):
	if ord(s[i]) <= ord(c):
		s[i] = c
		c = chr(ord(c) + 1)
		if ord(c) > ord('z'):
			flag = True
			break
if flag:
	print(''.join(s))
else:
	print('-1')


raw = input()
current = 97
alp = ''
for a in raw:
	if ord(a) <= current and current <= ord('z'):
		alp += chr(current)
		current += 1
	else:
		alp += a
if current <= ord('z'):
	print(-1)
else:
	print(alp)


s = list(input())
cur = 'a'
end = False
ans = []
for c in s:
	if c == 'z':
		end |= cur == 'z'
		ans += ['z']
	elif c <= cur:
		ans += [cur]
		end |= cur == 'z'
		if cur != 'z':
			cur = chr(ord(cur) + 1)
	else:
		ans += [c]
if end:
	print(''.join(ans))
else:
	print(-1)


a = list(input())
i = 0
k = 0
l = len(a)
while i < l:
	if a[i] <= chr(97 + k):
		if k < 26:
			a[i] = chr(97 + k)
			k += 1
	i += 1
if k == 26:
	print(''.join(a))
else:
	print(-1)


s = input()
c = 'a'
f = 0
for i in range(len(s)):
	if ord(s[i]) <= ord(c):
		s = s[:i] + c + s[i + 1:]
		c = chr(ord(c) + 1)
	if ord(c) > 122:
		f = 1
		break
if f:
	print(s)
else:
	print(-1)


s = input()
ans = [0] * len(s)
cur = 0
for i in range(len(s)):
	if cur < 26 and ord(s[i]) - ord('a') <= cur:
		ans[i] = cur + ord('a')
		cur += 1
	else:
		ans[i] = ord(s[i])
if cur == 26:
	for x in ans:
		print(chr(x), end='')
else:
	print(-1)


s = input()
curr = 'a'
for i in range(len(s)):
	if s[i] <= curr:
		s = s[:i] + curr + s[i + 1:]
		curr = chr(ord(curr) + 1)
	if curr > 'z':
		print(s)
		exit()
print(-1)


s = input()
st = 'abcdefghijklmnopqrstuvwxyz'
l = []
c = 0
f = 0
n = len(s)
for i in range(n):
	if c >= 26:
		l.append(s[i])
	elif s[i] <= st[c]:
		l.append(st[c])
		c += 1
	else:
		l.append(s[i])
	if c == len(st):
		f = 1
if f:
	s1 = ''.join(l)
	print(s1)
else:
	print(-1)


x = 'abcdefghijklmnopqrstuvwxyz'
y = str(input())
yLista = list(y)
index = {}
for i in range(len(x)):
	index[x[i]] = i
t = 0
k = 1
if len(x) > len(y):
	pass
else:
	for i in range(len(y)):
		if index[yLista[i]] <= index[x[t]]:
			yLista[i] = x[t]
			if x[t] == 'z':
				k = 0
				break
			t = t + 1
y = ''.join(yLista)
if k == 0:
	print(y)
else:
	print(-1)