#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int flag = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == s[i - 1]) {
        flag = 1;
        cout << -1 << endl;
        break;
      }
      if (s[i] == '?') {
        s[i] = (s[i - 1] - 'a' + 1) % 3 + 'a';
        if (s[i] == s[i + 1]) s[i] = (s[i] - 'a' + 1) % 3 + 'a';
      }
    }
    if (flag == 0) cout << s << endl;
  }
  return 0;
}
