#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  cin.ignore(numeric_limits<streamsize>::max(), '\n');
  while (t--) {
    string s;
    long long int c = 0;
    getline(cin, s);
    for (long long int i = 0; i < s.length(); i++) {
      if (s[i] != '?' && s[i] == s[i + 1]) {
        c++;
        break;
      } else if (s[i] == '?') {
        if (s[i - 1] != 'a' && s[i + 1] != 'a')
          s[i] = 'a';
        else 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';
      }
    }
    if (c != 0)
      cout << "-1" << endl;
    else
      cout << s << endl;
  }
  return 0;
}
