ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segment of letters) of it of length 26 where each letter of English alphabet appears exactly once. In particular, if the string has length strictly less than 26, no such substring exists and thus it is not nice.

Now, ZS the Coder tells you a word, where some of its letters are missing as he forgot them. He wants to determine if it is possible to fill in the missing letters so that the resulting word is nice. If it is possible, he needs you to find an example of such a word as well. Can you help him?


-----Input-----

The first and only line of the input contains a single string s (1 ≤ |s| ≤ 50 000), the word that ZS the Coder remembers. Each character of the string is the uppercase letter of English alphabet ('A'-'Z') or is a question mark ('?'), where the question marks denotes the letters that ZS the Coder can't remember.


-----Output-----

If there is no way to replace all the question marks with uppercase letters such that the resulting word is nice, then print  - 1 in the only line.

Otherwise, print a string which denotes a possible nice word that ZS the Coder learned. This string should match the string from the input, except for the question marks replaced with uppercase English letters.

If there are multiple solutions, you may print any of them.


-----Examples-----
Input
ABC??FGHIJK???OPQR?TUVWXY?

Output
ABCDEFGHIJKLMNOPQRZTUVWXYS
Input
WELCOMETOCODEFORCESROUNDTHREEHUNDREDANDSEVENTYTWO

Output
-1
Input
??????????????????????????

Output
MNBVCXZLKJHGFDSAQPWOEIRUYT
Input
AABCDEFGHIJKLMNOPQRSTUVW??M

Output
-1


-----Note-----

In the first sample case, ABCDEFGHIJKLMNOPQRZTUVWXYS is a valid answer beacuse it contains a substring of length 26 (the whole string in this case) which contains all the letters of the English alphabet exactly once. Note that there are many possible solutions, such as ABCDEFGHIJKLMNOPQRSTUVWXYZ or ABCEDFGHIJKLMNOPQRZTUVWXYS.

In the second sample case, there are no missing letters. In addition, the given string does not have a substring of length 26 that contains all the letters of the alphabet, so the answer is  - 1.

In the third sample case, any string of length 26 that contains all letters of the English alphabet fits as an answer.

Difficulty: interview

Starter code:

Solutions:
# You lost the game.
s = str(input())
n = len(s)
A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if n < 26:
    print(-1)
else:
    for i in range(n-25):
        ok = 1
        F = [0 for _ in range(26)]
        for j in range(26):
            if s[i:i+26].count(A[j]) > 1:
                ok = 0
                break
            elif s[i:i+26].count(A[j]) == 0:
                F[j] = 1
        if ok:
            break
    if ok == 0:
        print(-1)
    else:
        j = 0
        for k in range(n):
            if s[k] == "?":
                if k >= i and k < i+26:
                    while F[j] == 0:
                        j += 1
                    print(A[j],end="")
                    F[j] = 0
                else:
                    print("A",end="")
            else:
                print(s[k],end="")
            


from collections import Counter


s = input()
for i in range(len(s) - 25):
    t = s[i:i + 26]
    cnt = Counter(t)
    if len(cnt) - ('?' in cnt) + cnt['?'] == 26:
        print(s[:i].replace('?', 'A'), end='')
        cur = 'A'
        for c in t:
            if c != '?':
                print(c, end='')
            else:
                while cur in cnt:
                    cur = chr(ord(cur) + 1)
                cnt[cur] += 1
                print(cur, end='')
        print(s[i + 26:].replace('?', 'A'))
        return
print(-1)


base = ord('A')

s = input()

if len(s) < 26:
    print(-1)
    return


for i in range(len(s)-25):
    ss = s[i:i+26]
    q = 0
    switch = [0] * 26
    for k in ss:
        if k == '?':
            q += 1
        else:
            switch[ord(k) - base] = 1
    if 26 - sum(switch) <= q:
        sl = list(ss)
        for ii in range(26):
            if sl[ii] == '?':
                for j in range(26):
                    if switch[j] == 0:
                        switch[j] = 1
                        sl[ii] = chr(base + j)
                        break
        news = s[0:i].replace('?','A') + ''.join(sl) + s[i+26:].replace('?','A')
        print(news)
        return
print(-1)
return

s=input()
t=[ord(c)-65 for c in s]
solved=False
for i in range(len(t)-25):
    tp=t[i:i+26]
    l=[]
    for k in range(26):
        if tp.count(k)==0:
            l+=[k]
        if tp.count(k)>1:
            break
    else:
        if not solved:
            solved=True
            for j in range(i):
                print(s[j] if s[j]!='?' else 'A',end='')
            c=0
            for j in range(i,i+26):
                if s[j]!='?':
                    print(s[j],end='')
                else:
                    print(chr(l[c]+65),end='')
                    c+=1
            for j in range(i+26,len(t)):
                print(s[j] if s[j]!='?' else 'A',end='')        
if not solved:
    print(-1)
            

#!/usr/bin/env python3


def main():
    try:
        while True:
            s = input()
            if len(s) < 26:
                print(-1)
                continue

            fq = [0] * 26
            bad_count = 0
            for c in s[:26]:
                if c != '?':
                    c = ord(c) - 65
                    fq[c] += 1
                    if fq[c] == 2:
                        bad_count += 1

            def check(pos):
                if bad_count > 0:
                    return False
                ls = list(s)
                cur = 0
                for i, c in enumerate(s[pos-26:pos], pos - 26):
                    if c == '?':
                        while fq[cur] > 0:
                            assert fq[cur] == 1
                            cur += 1
                        ls[i] = chr(cur + 65)
                        fq[cur] = 1

                print("".join(ls).replace('?', 'A'))
                return True

            for i, c in enumerate(s[26:], 26):
                if check(i):
                    break
                if s[i - 26] != '?':
                    c0 = ord(s[i - 26]) - 65
                    fq[c0] -= 1
                    if fq[c0] == 1:
                        bad_count -= 1

                if c != '?':
                    c = ord(c) - 65
                    fq[c] += 1
                    if fq[c] == 2:
                        bad_count += 1
            else:
                if not check(len(s)):
                    print(-1)

    except EOFError:
        pass


main()


import string

s = str(input())

answer = ""

for i in range(max(1, len(s) - 26) + 1):
    temp = set()
    count = 0
    current_s = list(s[i:i + 26])
    for element in current_s:
        if element == "?":
            count += 1
        else:
            temp.add(element)

    if len(temp) + count == 26:
        for j in range(26):
            if current_s[j] == "?":
                for element in list(string.ascii_uppercase):
                    if element not in temp:
                        temp.add(element)
                        current_s[j] = element
                        break

        answer += s[:i].replace("?", "A") + "".join(map(str, current_s)) + s[i + 26:].replace("?", "A")
        break

if answer != "":
    print(answer)
else:
    print(-1)

s = input()
f = False
for i in range(len(s) - 25):
	subs = s[i:i + 26]
	q = False
	for j in subs:
		if j == '?':
			continue
		elif subs.count(j) > 1:
			q = True
			break
	if q:
		continue
	else:
		f = True
		u = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
		for j in u:
			if j not in subs:
				subs = subs[:subs.find('?')] + j + subs[subs.find('?') + 1:]
		s = s[:i] + subs + s[i + 26:]
		break
if (f):
	s = s.replace('?', 'A')
	print(s)
else:
	print(-1)

def fill_uniq(nice,cts):
    l_nice = list(nice)
    letters = [chr(ord('A')+i) for i in range(26) if not cts[i]]
    l_i = 0
    for i,c in enumerate(l_nice):
        if c == '?':
            l_nice[i] = letters[l_i]
            l_i += 1
    return ''.join(l_nice)

def ans(s, i, cts):
    nice = s[i:i+26]
    return s[:i].replace('?','A') + fill_uniq(nice,cts) + s[i+26:].replace('?','A')

def main():
    s = input()

    if len(s) < 26:
        print(-1)
        return

    cts = [0]*26
    for c in s[:26]:
        if c == '?': continue
        cts[ord(c)-ord('A')] += 1
    max_ct = max(cts)
    if max_ct <= 1:
        print(ans(s,0,cts))
        return

    for i in range(1,len(s) - 26+1):
        if s[i-1] != '?':
            cts[ord(s[i-1]) - ord('A')] -= 1
        if s[i+25] != '?':
            cts[ord(s[i+25]) - ord('A')] += 1
        #print(s[i-1], i,cts,sum(cts))
        max_ct = max(cts)
        if max_ct <= 1:
            print(ans(s,i,cts))
            return
    print(-1)

main()


from collections import Counter

s = input()
if len(s) < 26:
    print(-1)
else:
    a = Counter(s[:26])
    score = len(a)
    if '?' in a:
        score += a['?'] - 1
    ans = []
    if score == 26:
        for c in s[:26]:
            if c == '?':
                for z in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
                    if not a[z]:
                        a[z] = 1
                        ans += z
                        break
            else:
                ans += c
        for c in s[26:]:
            ans += 'A' if c == '?' else c
        print(''.join(ans))
    else:
        for i, c in enumerate(s[26:]):
            p = s[i]
            ans += 'A' if p == '?' else p
            a[p] -= 1
            if p == '?' or a[p] == 0:
                score -= 1
            a[c] += 1
            if c == '?' or a[c] == 1:
                score += 1
            if score == 26:
                for c in s[i+1:i+27]:
                    if c == '?':
                        for z in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
                            if not a[z]:
                                a[z] = 1
                                ans += z
                                break
                    else:
                        ans += c
                for c in s[i+27:]:
                    ans += 'A' if c == '?' else c
                print(''.join(ans))
                break
        else:
            print(-1)


s=input()
v=[i for i in s]
t=[0 for i in range(26)]
f=0
q=0
for i in range(len(v)):
    if(v[i]=='?'):
        q=q+1
    else:
        t[ord(v[i])-65] += 1
    if(i>24):
        c=t.count(0)
        if(c==q):
            d=[]
            for k in range(26):
                if(t[k]==0):
                    d.append(chr(k+65))
            l=0
            for k in range(0,i-25):
                if(v[k]=='?'):
                    print('A',end="")
                else:
                    print(v[k],end="")
            for k in range(i-25,i+1):
                if(v[k]=='?'):
                    print(d[l],end="")
                    l=l+1
                else:
                    print(v[k],end="")
            for k in range(i+1,len(v)):
                if(v[k]=='?'):
                    print('A',end="")
                else:
                    print(v[k],end="")
                
            f=1
            break
        else:
            if(v[i-25]=='?'):
                q=q-1
            else:
                t[ord(v[i-25])-65] -= 1
if(f==0):
    print("-1")
        
    


s=input()
n=len(s)
i=0
a=[(0,0) for x in range(0,26)]
l=0
b=0
while i<n:
    if s[i]=='?':
        i+=1
        l+=1
    else:
        intc=ord(s[i])-ord('A')
        if a[intc][0]==0:
            #print("if",intc)
            a[intc]=(1,i)
            l+=1
            i+=1
        else:
            #print("else",intc)
            i=a[intc][1]+1
            l=0
            for k in range(0,26):
                a[k]=(0,0)
    if l==26:
        b=1
        i-=26
        break
p=list(s)
if b==0:
    print(-1)
else:
    for j in range(i,i+26):
        if p[j]=='?':
            for k in range(0,26):
                if a[k][0]==0:
                    a[k]=(1,0)
                    p[j]=chr(k+ord('A'))
                    break
    for j in range(0,n):
        if p[j]=='?':
            p[j]='A'
    w="".join(p)
    print(w)


s=input()
n=len(s)
l=[]
x=0
y=0
f=0
k=0
for i in range (26):
	l.append(0)
for i in range (n-25):
	for t in range (26):
		if s[i+t]=='?':
			y=y+1
		elif l[ord(s[i+t])-ord('A')]==0:
			l[ord(s[i+t])-ord('A')]=1
			y=y+1
		else:
			for j in range (26):
				l[j]=0
			y=0
		if y==26:
			f=1
			break
	if f==1:
		break
	for j in range (26):
		l[j]=0
	y=0
i=i+25
if f==0:
	print(-1)
else:
	for j in range(n):
		if j<(i-25) or (j>i):
			if s[j]=='?':
				print('A', end='')
			else:
				print(s[j], end='')
		else:
			if s[j]=='?':
				while l[k]!=0:
					k=k+1
				
				print(chr(k+ord('A')), end='')
				k=k+1
			else:
				print(s[j], end='')
print

	


def is_nice(strs):
    strs = list(strs)
    if len(strs) < 26:
        return -1
    satis = False
    for i in range(len(strs)-26+1):
        ret = strs[i:i+26]
        seen = [0]*26
        for c in ret:
            if c == '?':
                continue
            seen[ord(c)-ord('A')] += 1
        if seen.count(0) != ret.count('?'):
            continue
        else:
            satis = True
            miss = ''
            for j in range(len(seen)):
                if seen[j] == 0:
                    miss += chr(j+ord('A'))
            idx = 0
            for c in range(len(ret)):
                if ret[c] == '?':
                    strs[i+c] = miss[idx]
                    idx += 1
        if satis:
            break
    if satis == False:
        return -1
    
    for i in range(len(strs)):
        if strs[i] == '?':
            strs[i] = 'A'
    return ''.join(strs)

s = input()
print(is_nice(s))


        
            


def main():
	s = input()
	n = len(s)
	if n < 26:
		print(-1)
		return
	s = list(s)
	n = len(s)
	j = 0
	x = ord('A')
	a = [0] * 26
	while j + 26 <= n:
		flag = 1		
		for k in range(j , j + 26):
			if s[k] != '?':
				if a[ord(s[k]) - x] == 0:
					a[ord(s[k]) - x] = 1
				else:
					a = [0] * 26
					j = j + 1
					flag = 0
					break
		# print(j, "")
		if flag == 1:
			p = 0
			for k in range(j, j + 26):
				if s[k] == "?":
					while a[p] != 0:
						p += 1
					s[k] = chr(x + p)
					p += 1
			for i in range(n):
				if s[i] == "?":
					s[i] = 'A'
			print("".join(s))

			return




	print(-1)







def __starting_point():
	main()
__starting_point()

s = input()
if(len(s) < 26):
    print(-1)
else:
    key = "ABCDEFGHIJKLMNOPQRSTUVWXYZ?"
    letters = dict()
    x = list(s)
    found = False
    for i in range(0, len(x)-25):
        oneCount = 0
        zeroCount = 0
        qCount = 0
        for j in key:
            letters[j] = 0
        for j in range(i, i+26):
            letters[x[j]] += 1
        for j in letters:
            if(letters[j] == 1) and (j.isalpha()):
                oneCount += 1
            elif(letters[j] == 0) and (j.isalpha()):
                zeroCount += 1
            elif(j == '?'):
                qCount += letters[j]
        if(qCount != zeroCount) or (oneCount + zeroCount != 26):
            continue
        else:
            for k in range(i, i+26):
                if(x[k] == '?'):
                    for j in letters:
                        if(letters[j] == 0) and (j.isalpha()):
                            x[k] = j
                            letters[j] += 1
                            break
            for k in range(len(x)):
                if(x[k] == '?'):
                    x[k] = 'A'
            print(''.join(x))
            found = True
            break
    if(found == False):
        print(-1)

def poss(ss):
    prr = [0 for i in range(26)]
    ques = 0
    for x in ss:
        if(x=='?'):
            ques += 1
        else:
            prr[ord(x)-65] = 1
    return (sum(prr)+ques)==26

def make(ss):
    prr = [0 for i in range(26)]
    for x in ss:
        if(x!='?'):
            prr[ord(x)-65] = 1
    ans = ''
    for x in ss:
        if(x=='?'):
            for i in range(26):
                if(prr[i]==0):
                    ans += chr(i+65)
                    prr[i] = 1
                    break
        else:
            prr[ord(x)-65] = 1
            ans += x
    return ans

s = input()
l = len(s)
if(l<26):
    print(-1)
else:
    ans = ''
    i = 26
    suc = 0
    while i<=l:
        if(poss(s[i-26:i])):
            ans += make(s[i-26:i])
            suc = 1
            break
        else:
            if(s[i-26]=='?'):
                ans += 'A'
            else:
                ans += s[i-26]
        i += 1
    for j in range(i,l):
        if(s[j]=='?'):
            ans += 'A'
        else:
            ans += s[j]
    if(suc):
        print(ans)
    else:
        print(-1)