#include <bits/stdc++.h>
using namespace std;
const int XI = INT_MAX, NI = INT_MIN, MOD = 1e9 + 7;
string s;
int a[400];
int main() {
  cin >> s;
  for (int i = 0; i < 26; i++) {
    a[s[i]]++;
  }
  for (int i = 25; i < s.length(); i++) {
    bool k = 1;
    int cnt = 0;
    string second = "";
    for (int j = 'A'; j <= 'Z'; j++) {
      if (a[j] > 1) {
        k = 0;
        break;
      }
      if (a[j] == 0) {
        cnt++;
        second += (char)j;
      }
    }
    if (cnt != a['?']) k = 0;
    if (k) {
      int y = 0;
      for (int x = 0; x < i - 25; x++) {
        if (s[x] != '?')
          cout << s[x];
        else
          cout << 'A';
      }
      for (int x = i - 25; x < i + 1; x++) {
        if (s[x] != '?')
          cout << s[x];
        else {
          cout << second[y];
          y++;
        }
      }
      for (int x = i + 1; x < s.length(); x++) {
        if (s[x] != '?')
          cout << s[x];
        else
          cout << 'A';
      }
      cout << endl;
      return 0;
    }
    if (i + 1 == s.size()) break;
    a[s[i + 1]]++;
    a[s[i - 25]]--;
  }
  cout << -1 << endl;
}
