#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  bool pr[26];
  unsigned long v[26];
  for (int i = 0; i < 26; ++i) pr[i] = 0;
  unsigned long n = s.length();
  int kol = 0;
  int i1 = 0;
  int length = 0;
  for (unsigned long i = 0; i < n; ++i) {
    length = 0;
    kol = 0;
    for (int i = 0; i < 26; ++i) pr[i] = 0;
    i1 = i;
    while ((length != 26) & (i < n)) {
      if (s[i] == '?') {
        kol++;
        length++;
        i++;
      } else {
        if (pr[s[i] - 'A'] == 1) {
          i = v[s[i] - 'A'];
          kol = 0;
          break;
        } else {
          pr[s[i] - 'A'] = 1;
          v[s[i] - 'A'] = i;
          length++;
          ++i;
        }
      }
    }
    if (length == 26) {
      for (unsigned long i = i1; i < (i1 + 26); ++i) {
        if (s[i] == '?') {
          for (int j = 0; j < 26; ++j) {
            if (pr[j] == 0) {
              s[i] = (char)('A' + j);
              pr[j] = 1;
              break;
            }
          }
        }
      }
      for (unsigned long i = 0; i < n; ++i) {
        if (i < i1 | i >= (i1 + 26)) {
          if (s[i] == '?') s[i] = 'A';
        }
      }
      break;
    }
    if (i == n) break;
  }
  if (length == 26)
    cout << s;
  else
    cout << -1;
  return 0;
}
