#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int i, l, j = 0;
    string s;
    cin >> s;
    l = s.length();
    for (i = 0; i < l; i++) {
      if (s[i] == s[i - 1]) {
        j = -1;
        break;
      }
      if (s[i] == '?') {
        for (j = 97; j <= 99; j++) {
          if (s[i - 1] != j && s[i + 1] != j) {
            s[i] = j;
            break;
          }
        }
      }
    }
    if (j == -1)
      cout << "-1\n";
    else
      cout << s << "\n";
  }
  return 0;
}
