#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int h = 0;
  map<char, int> m;
  int me = 0, a = 0;
  if (s.size() >= 26) {
    int i = 0, k = 26;
    for (int j = 0; j < 26; j++) {
      if (s[j] != '?') {
        m[s[j]]++;
        if (m[s[j]] == 1) a++;
      } else
        me++;
    }
    if (me + a == 26) {
      for (int j = i; j < k; j++) {
        if (s[j] == '?') {
          for (char f = 'A'; f <= 'Z'; f++) {
            if (m[f] == 0) {
              s[j] = f;
              m[f]++;
              break;
            }
          }
        }
      }
      h = 1;
    }
    while (k <= s.size()) {
      if (h) break;
      if (me + a == 26) {
        for (int j = i; j < k; j++) {
          if (s[j] == '?') {
            for (char f = 'A'; f <= 'Z'; f++) {
              if (m[f] == 0) {
                s[j] = f;
                m[f]++;
                break;
              }
            }
          }
        }
        h = 1;
      }
      if (h) break;
      if (s[i] != '?') {
        m[s[i]]--;
        if (m[s[i]] == 0) a--;
      } else
        me--;
      i++;
      if (s[k] != '?') {
        m[s[k]]++;
        if (m[s[k]] == 1) a++;
      } else
        me++;
      k++;
    }
  }
  if (h) {
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '?') s[i] = 'A';
      cout << s[i];
    }
  } else
    cout << -1 << endl;
  return 0;
}
