#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
char str[maxn];
char c[4] = {'a', 'a', 'b', 'c'};
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%s", str + 1);
    int len = strlen(str + 1);
    bool flag = false;
    for (int i = 2; i <= len; i++) {
      if (str[i] != '?' && str[i] == str[i - 1]) {
        flag = true;
        break;
      }
    }
    if (flag) {
      printf("-1\n");
      continue;
    }
    for (int i = 1; i <= len; i++) {
      if (str[i] == '?') {
        for (int j = 1; j <= 3; j++) {
          if (c[j] != str[i - 1] && c[j] != str[i + 1]) {
            str[i] = c[j];
            break;
          }
        }
      }
    }
    printf("%s\n", str + 1);
  }
  return 0;
}
