#include <bits/stdc++.h>
using namespace std;
int main() {
  int len, i, j, t, pos, st, fd, cnt;
  int a[30];
  char s[50010];
  int b[30];
  memset(a, 0, sizeof(a));
  scanf("%s", s);
  len = strlen(s);
  st = 0;
  cnt = 0;
  fd = 0;
  for (i = 0; i < len; i++) {
    cnt++;
    if (s[i] != '?') {
      t = s[i] - 'A';
      a[t]++;
      if (a[t] > 1) {
        pos = b[t];
        cnt = i - pos;
        for (j = st; j <= b[t]; j++) {
          if (s[j] != '?') a[s[j] - 'A']--;
        }
        st = b[t] + 1;
      }
      b[t] = i;
    }
    if (cnt >= 26) {
      fd = 1;
      break;
    }
  }
  if (fd == 1) {
    for (i = 0; i < st; i++) {
      if (s[i] == '?')
        printf("A");
      else
        printf("%c", s[i]);
    }
    for (i = st; i < st + 26; i++) {
      if (a[s[i] - 'A'] == 1)
        printf("%c", s[i]);
      else {
        for (j = 0; j < 26; j++) {
          if (a[j] == 0) {
            printf("%c", j + 'A');
            a[j]++;
            break;
          }
        }
      }
    }
    for (i = st + 26; i < len; i++) {
      if (s[i] == '?')
        printf("A");
      else
        printf("%c", s[i]);
    }
    printf("\n");
  } else
    printf("-1\n");
  return 0;
}
