#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  string solve(string s) {
    for (size_t i = 0; i < s.size(); ++i) {
      if (s[i] == '?') {
        bool chars[] = {false, false, false};
        if (i && s[i - 1] != '?') chars[s[i - 1] - 'a'] = true;
        if (i + 1 < s.size() && s[i + 1] != '?') chars[s[i + 1] - 'a'] = true;
        s[i] = !chars[0] ? 'a' : !chars[1] ? 'b' : 'c';
      }
      if (i && s[i] == s[i - 1]) return "-1";
    }
    return s;
  }
};
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    string s;
    cin >> s;
    string result = Solution().solve(s);
    cout << result << endl;
  }
  return 0;
}
