#include <bits/stdc++.h>
using namespace std;
const double pi = 4 * atan(1.0);
constexpr long long mod = static_cast<long long>(1e9 + 7);
using cEdges = vector<vector<int>>;
bool check(array<int, 26>& arr, int blanks) {
  int num = 0;
  for (int i = 0; i < 26; ++i) {
    if (arr[i] > 1)
      return false;
    else if (arr[i] == 0) {
      ++num;
    }
  }
  return num <= blanks ? true : false;
}
int main() {
  string str;
  cin >> str;
  if (str.size() < 26) {
    cout << -1 << endl;
  } else {
    array<int, 26> a;
    a.fill(0);
    int BlankNum = 0;
    bool ans = false;
    int Index = 0;
    for (int i = 0; i < 26; ++i) {
      if (str[i] == '?') {
        ++BlankNum;
      } else {
        ++a[str[i] - 'A'];
      }
    }
    if (check(a, BlankNum)) {
      ans = true;
    } else {
      for (int i = 0; i < str.size() - 26; ++i) {
        if (str[i] == '?')
          --BlankNum;
        else {
          --a[str[i] - 'A'];
        }
        if (str[i + 26] == '?')
          ++BlankNum;
        else {
          ++a[str[i + 26] - 'A'];
        }
        if (check(a, BlankNum)) {
          ans = true;
          Index = i + 1;
          break;
        }
      }
    }
    if (ans) {
      for (int i = 0; i < Index; ++i) {
        if (str[i] != '?')
          cout << str[i];
        else
          cout << 'A';
      }
      for (int i = Index; i < Index + 26; ++i) {
        if (str[i] != '?')
          cout << str[i];
        else {
          for (int j = 0; j < 26; ++j) {
            if (a[j] == 0) {
              cout << static_cast<char>('A' + j);
              ++a[j];
              break;
            }
          }
        }
      }
      for (int i = Index + 26; i < str.size(); ++i) {
        if (str[i] != '?')
          cout << str[i];
        else
          cout << 'A';
      }
      cout << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
