#include <bits/stdc++.h>
using namespace std;
set<char> st;
vector<long long> p;
vector<long long>::iterator it;
long long cnt[100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long x, y, l, r, i, j;
  int flag = 0;
  string s;
  cin >> s;
  if (s.length() < 26) {
    cout << "-1\n";
    return 0;
  }
  x = 0;
  for (i = 0; i < 26; i++) {
    if (s[i] == '?') {
      x++;
      p.push_back(i);
    } else {
      cnt[s[i] - 'A']++;
      st.insert(s[i]);
    }
  }
  y = st.size();
  if (x + y == 26) {
    flag = 1;
    it = p.begin();
    for (j = 0; j < 26; j++) {
      if (cnt[j] == 0) {
        s[*it] = 'A' + j;
        it++;
      }
    }
    l = 0;
    r = i - 1;
    goto next;
  }
  i = 1;
  j = 26;
  while (j < s.length()) {
    if (s[i - 1] == '?') {
      x--;
      p.erase(p.begin());
    } else if (cnt[s[i - 1] - 'A'] == 1) {
      st.erase(s[i - 1]);
    }
    cnt[s[i - 1] - 'A']--;
    if (s[j] == '?') {
      x++;
      p.push_back(j);
    } else {
      st.insert(s[j]);
      cnt[s[j] - 'A']++;
    }
    y = st.size();
    if (x + y == 26) {
      flag = 1;
      it = p.begin();
      for (j = 0; j < 26; j++) {
        if (cnt[j] == 0) {
          s[*it] = 'A' + j;
          it++;
        }
      }
      l = i;
      r = j;
      goto next;
    }
    i++;
    j++;
  }
next:
  if (flag == 0) {
    cout << "-1\n";
    return 0;
  }
  for (i = l - 1; i >= 0; i--) {
    if (s[i] == '?') s[i] = 'A';
  }
  for (i = r + 1; i < s.length(); i++) {
    if (s[i] == '?') s[i] = 'A';
  }
  cout << s << endl;
  return 0;
}
