#include <bits/stdc++.h>
using namespace std;
const int INF1 = (~0u >> 2);
const long long INF2 = (~0ull >> 2), P1 = 10007, P2 = 998244353,
                P3 = 1000000007;
const char ch[5][5] = {"bcb", "caa", "baa"};
char s[100010];
int len;
void solve() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  for (int i = 1; i <= len; i++) {
    if (s[i] != '?' && s[i] == s[i - 1]) {
      printf("-1\n");
      return;
    }
    if (s[i] == '?') {
      if (i == 1)
        if (s[i + 1] == '?')
          s[i] = 'a';
        else
          s[i] = (s[i + 1] == 'a' ? 'b' : 'a');
      else if (i == len)
        s[i] = (s[i - 1] == 'a' ? 'b' : 'a');
      else if (s[i + 1] == '?')
        s[i] = (s[i - 1] == 'a' ? 'b' : 'a');
      else
        s[i] = ch[s[i - 1] - 'a'][s[i + 1] - 'a'];
    }
  }
  printf("%s\n", s + 1);
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    solve();
    for (int i = 1; i <= len; i++) s[i] = 0;
  }
  return 0;
}
