#include <bits/stdc++.h>
int convertable(char s[]) {
  for (int i = 1; s[i]; i++) {
    if (s[i] == s[i - 1] && s[i] != '?') return 0;
  }
  return 1;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    char s[100000];
    scanf("%s", s);
    if (convertable(s)) {
      for (int i = 0; s[i]; i++) {
        if (s[i] == '?') {
          char c[3] = {0};
          if (i != 0 && s[i - 1] != '?') c[s[i - 1] - 'a'] = 1;
          if (s[i + 1] && s[i + 1] != '?') c[s[i + 1] - 'a'] = 1;
          if (!c[0])
            s[i] = 'a';
          else if (!c[1])
            s[i] = 'b';
          else
            s[i] = 'c';
        }
      }
      printf("%s\n", s);
    } else
      printf("-1\n");
  }
  return 0;
}
