#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int i, n;
  n = s.length();
  for (i = 0; i < n; i++) {
    if (s[i] == '?') {
      if (s[i + 1] != 'b' && s[i - 1] != 'b')
        s[i] = 'b';
      else {
        if (s[i + 1] != 'c' && s[i - 1] != 'c')
          s[i] = 'c';
        else {
          if (s[i + 1] != 'a' && s[i - 1] != 'a') s[i] = 'a';
        }
      }
    }
    if (s[i] == s[i - 1] || s[i] == s[i + 1]) {
      cout << -1 << endl;
      return;
    }
  }
  cout << s << endl;
}
int main() {
  int qq;
  cin >> qq;
  while (qq--) solve();
}
