#include <bits/stdc++.h>
using namespace std;
string s;
int cnt[200];
int q;
int main() {
  cin >> s;
  int i, j;
  int solve = 0;
  for (i = 0; s[i]; i++) {
    memset(cnt, 0, sizeof(cnt));
    q = 0;
    for (j = i; s[j] && j < i + 26; j++) {
      if (s[j] >= 'A' && s[j] <= 'Z') cnt[s[j]]++;
      if (s[j] == '?') q++;
    }
    if (j != i + 26) break;
    int flag = 0;
    for (j = 'A'; j <= 'Z'; j++) {
      if (cnt[j] == 0) q--;
      if (cnt[j] > 1) {
        flag = 1;
        break;
      }
    }
    if (flag) continue;
    if (q == 0) {
      for (j = i; j < i + 26; j++) {
        if (s[j] == '?') {
          int k;
          for (k = 'A'; k <= 'Z'; k++) {
            if (cnt[k] == 0) {
              cnt[k] = 1;
              s[j] = k;
              break;
            }
          }
        }
      }
      solve = 1;
      break;
    }
  }
  if (!solve) {
    cout << -1 << endl;
    return 0;
  }
  for (i = 0; s[i]; i++) {
    if (s[i] == '?') s[i] = 'A';
  }
  cout << s << endl;
  return 0;
}
