#include <bits/stdc++.h>
using namespace std;
template <typename T, typename L>
bool smax(T &x, L y) {
  return x < y ? (x = y, true) : false;
}
template <typename T, typename L>
bool smin(T &x, L y) {
  return y < x ? (x = y, true) : false;
}
const int MAXN = 26;
string s;
int mark[MAXN];
int cnt, num;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cerr << "HELLO WORLD :|\n";
  cin >> s;
  if (s.size() < 26) return cout << "-1", false;
  for (int i = 0; i < 26; i++) {
    if (s[i] != '?') {
      mark[s[i] - 'A']++;
      if (mark[s[i] - 'A'] == 1) num++;
    } else
      cnt++;
  }
  for (int i = 0; i < (int)s.size() - 25; i++) {
    if (num + cnt >= 26) {
      for (int j = 0; j < i; j++)
        if (s[j] == '?') s[j] = 'A';
      for (int j = i; j < i + 26; j++)
        if (s[j] == '?') {
          for (char c = 'A'; c <= 'Z'; c++)
            if (!mark[c - 'A']) {
              mark[c - 'A']++;
              s[j] = c;
              break;
            }
        }
      for (int j = i + 26; j < (int)s.size(); j++)
        if (s[j] == '?') s[j] = 'A';
      return cout << s << '\n', false;
    }
    if (s[i] == '?') cnt--;
    mark[s[i] - 'A']--;
    if (!mark[s[i] - 'A'] && s[i] != '?') num--;
    if (i + 26 < (int)s.size()) {
      if (s[i + 26] == '?') cnt++;
      if (s[i + 26] != '?') {
        mark[s[i + 26] - 'A']++;
        if (mark[s[i + 26] - 'A'] == 1 && s[i + 26] != '?') num++;
      }
    }
  }
  return cout << "-1\n", false;
}
