#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
const int mod = 1000000007;
char s[N];
long long a[N];
void ck(int pos, char c) {
  if (s[pos] != '?') return;
  if (s[pos - 1] != c && s[pos + 1] != c) s[pos] = c;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n, m, t;
  cin >> t;
  s[0] = 'a';
  while (t--) {
    cin >> s + 1;
    int len = strlen(s + 1);
    for (int i = 1; i <= len; i++) {
      if (s[i] == s[i + 1] && s[i] != '?') {
        puts("-1");
        goto loop;
      }
      if (s[i] == '?') {
        ck(i, 'a');
        ck(i, 'b');
        ck(i, 'c');
      }
    }
    printf("%s\n", s + 1);
  loop:;
  }
  return 0;
}
