#include <bits/stdc++.h>
using namespace std;
string str = "abcabcabcabcabcabc";
int main() {
  int n;
  string s;
  cin >> n;
  getchar();
  while (n--) {
    cin >> s;
    int i, j, flag = 0;
    if (s.length() > 1)
      for (i = 1; i < s.length(); i++)
        if (s[i] == s[i - 1] && s[i] != '?') {
          flag = 1;
          break;
        }
    if (flag == 1)
      cout << "-1" << endl;
    else {
      if (s[0] == '?') {
        s[0] = 'a';
        if (s[0] == s[1]) s[0]++;
      }
      for (i = 0; i < s.length(); i++) {
        if (s[i] == '?') {
          s[i] = str[s[i - 1] - 'a' + 1];
        }
        if (s[i] == s[i + 1]) {
          s[i]++;
        }
        if (s[i] == 'd') s[i] = 'a';
      }
      cout << s << endl;
    }
  }
  return 0;
}
