/*
Name : Mohit Khare
B.Tech 2nd Year
Computer Science and Engineering
MNNIT Allahabad
*/
#include <bits/stdc++.h>
using namespace std;
#define F(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define RF(i,a,b) for(int i = (int)(a); i > (int)(b); i--)
#define ll long long int
#define ull unsigned long long int
#define pii pair < int , int >
#define pb push_back
#define mp make_pair
#define mod 1000000007
int main()
{
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
char ch[500000],st[26],ans[26];
cin>>ch;
int hash[26],cnt=0,q=0,f=0,m=0,p=0;
int len = strlen(ch),i;
if(len<26)
{
cout<<"-1"<<endl;
return 0;
}
for( i = 0;i<=len-26;i++)
{
for(int j = 0;j<26 ; j++)
{
if(ch[i+j]!='?')
hash[ch[i+j]-'A']++;
else q++;
}
for(int k = 0 ;k<26;k++)
{
if(hash[k]==0)
{
cnt++;
st[m]=(char)('A'+k);
m++;
}
}
m=0;
if(cnt<=q)
{
f=1;
for(int k= 0;k<26;k++)
{
if(ch[i+k]=='?')
{
ans[p]=st[m];
p++;
m++;
}
else
{
ans[p]=ch[i+k];
p++;
}
}
break;
}
cnt =0;
q=0;
m=0;
memset(hash,0,sizeof(hash));
char st[26];
}
if(f)
{
for(m =0;m<i;m++)
if(ch[m]=='?')
cout<<"A";
else cout<<ch[m];
cout<<ans;
for( m=26+i;m<len;m++)
{
if(ch[m]=='?')
cout<<"A";
else cout<<ch[m];
}
}
else cout<<-1<<endl;
return 0;
}
LyogCk5hbWUgOiBNb2hpdCBLaGFyZSAKQi5UZWNoIDJuZCBZZWFyCkNvbXB1dGVyIFNjaWVuY2UgYW5kIEVuZ2luZWVyaW5nCk1OTklUIEFsbGFoYWJhZAoqLyAgICAKI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgRihpLGEsYikgZm9yKGludCBpID0gKGludCkoYSk7IGkgPCAoaW50KShiKTsgaSsrKQojZGVmaW5lIFJGKGksYSxiKSBmb3IoaW50IGkgPSAoaW50KShhKTsgaSA+IChpbnQpKGIpOyBpLS0pCiNkZWZpbmUgbGwgbG9uZyBsb25nIGludAojZGVmaW5lIHVsbCB1bnNpZ25lZCBsb25nIGxvbmcgaW50CiNkZWZpbmUgcGlpIHBhaXIgPCBpbnQgLCBpbnQgPgojZGVmaW5lIHBiIHB1c2hfYmFjawojZGVmaW5lIG1wIG1ha2VfcGFpcgojZGVmaW5lIG1vZCAxMDAwMDAwMDA3CmludCBtYWluKCkKewoJLy9mcmVvcGVuKCJpbnB1dC50eHQiLCJyIixzdGRpbik7CiAgICAvL2ZyZW9wZW4oIm91dHB1dC50eHQiLCJ3IixzdGRvdXQpOwogICAgY2hhciBjaFs1MDAwMDBdLHN0WzI2XSxhbnNbMjZdOwogICAgY2luPj5jaDsKICAgIGludCBoYXNoWzI2XSxjbnQ9MCxxPTAsZj0wLG09MCxwPTA7CiAgICBpbnQgbGVuID0gc3RybGVuKGNoKSxpOwogICAgaWYobGVuPDI2KQogICAgewogICAgCWNvdXQ8PCItMSI8PGVuZGw7CiAgICAJcmV0dXJuIDA7CiAgICB9CiAgICBmb3IoIGkgPSAwO2k8PWxlbi0yNjtpKyspCiAgICB7CiAgICAJZm9yKGludCBqID0gMDtqPDI2IDsgaisrKQogICAgCXsKICAgIAkJaWYoY2hbaStqXSE9Jz8nKQogICAgCQloYXNoW2NoW2kral0tJ0EnXSsrOwogICAgCQllbHNlIHErKzsKICAgIAl9CiAgICAJZm9yKGludCBrID0gMCA7azwyNjtrKyspCiAgICAJewogICAgCQlpZihoYXNoW2tdPT0wKQogICAgCQl7CiAgICAJCQljbnQrKzsKICAgIAkJCXN0W21dPShjaGFyKSgnQScrayk7CiAgICAJCQltKys7CiAgICAJCX0JCiAgICAJfQogICAgCW09MDsKICAgIAlpZihjbnQ8PXEpCiAgICAJewogICAgCQlmPTE7CiAgICAJCWZvcihpbnQgaz0gMDtrPDI2O2srKykKICAgIAkJewogICAgCQkJaW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