#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 256;
const char nxtl = '\n';
const double eps = (double)1e-9;
template <typename T>
inline bool updmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool updmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
string s;
int pref[MAXN][30];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  if (((int)(s.size())) < 26) {
    puts("-1");
    return 0;
  }
  for (int i = 0; i <= ((int)(s.size())) - 1; ++i) {
    if (i > 0) {
      for (int j = 0; j <= 25; ++j) pref[i][j] += pref[i - 1][j];
    }
    if (s[i] != '?')
      pref[i][s[i] - 'A']++;
    else {
      pref[i][26]++;
    }
    if (i > 0) pref[i][26] += pref[i - 1][26];
  }
  for (int i = 25; i <= ((int)(s.size())) - 1; ++i) {
    int sum = 0;
    bool ok = 1;
    for (int j = 0; j <= 25; ++j) {
      sum += (pref[i][j] - (i > 25 ? pref[i - 26][j] : 0) < 1);
      ok &= (pref[i][j] - (i > 25 ? pref[i - 26][j] : 0) <= 1);
    }
    int sum2 = pref[i][26] - (i > 25 ? pref[i - 26][26] : 0);
    if (ok && sum <= sum2) {
      int val = 0;
      for (int j = i - 25; j <= i; ++j) {
        if (s[j] == '?') {
          if (val > 25) {
            puts("-1");
            return 0;
          }
          while (val <= 26 &&
                 pref[i][val] - (i > 25 ? pref[i - 26][val] : 0) == 1)
            val++;
          s[j] = val + 'A';
          val++;
        }
        sum -= (pref[i][val] - (i > 25 ? pref[i - 26][val] : 0) < 1);
      }
      for (auto &to : s)
        if (to == '?') to = 'A';
      cerr << nxtl;
      cout << s << nxtl;
      return 0;
    }
  }
  puts("-1");
  return 0;
}
