#include <bits/stdc++.h>
using namespace std;
string s;
deque<int> dq;
map<char, int> cnt;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  if (s.size() < 26) {
    cout << -1;
    return 0;
  }
  bool ok = true;
  for (int i = 0; i <= 25; i++) {
    if (s[i] == '?')
      dq.push_back(i);
    else
      cnt[s[i]]++;
  }
  for (int i = 0; i <= 25; i++) {
    if (cnt[s[i]] >= 2) {
      ok = false;
      break;
    }
  }
  if (ok) {
    for (char i = 'A'; i <= 'Z'; i++) {
      if (cnt[i] == 0) {
        cnt[i]++;
        s[dq.front()] = i;
        dq.pop_front();
      }
    }
    for (int i = 26; i < s.size(); i++)
      if (s[i] == '?') s[i] = 'A';
    cout << s;
    return 0;
  }
  int d = 1, c = 26;
  while (c <= s.size() - 1) {
    ok = true;
    if (s[d - 1] == '?')
      dq.pop_front();
    else
      cnt[s[d - 1]]--;
    if (s[c] == '?')
      dq.push_back(c);
    else
      cnt[s[c]]++;
    for (int i = d; i <= c; i++) {
      if (cnt[s[i]] >= 2) {
        ok = false;
        break;
      }
    }
    if (ok) {
      for (char i = 'A'; i <= 'Z'; i++) {
        if (cnt[i] == 0) {
          cnt[i]++;
          s[dq.front()] = i;
          dq.pop_front();
        }
      }
      for (int i = 0; i <= d - 1; i++)
        if (s[i] == '?') s[i] = 'A';
      for (int i = c + 1; i < s.size(); i++)
        if (s[i] == '?') s[i] = 'A';
      cout << s;
      return 0;
    }
    d++;
    c++;
  }
  cout << -1;
}
