#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int n = s.size();
    char abc[3] = {'a', 'b', 'c'};
    char prev, next;
    for (int i = 0; i < n; i++) {
      if (i == 0 && s[i] == '?') {
        next = s[i + 1];
        for (auto x : abc) {
          if (x != next) s[i] = x;
        }
      } else if (i == n - 1 && s[i] == '?') {
        prev = s[i - 1];
        for (auto x : abc) {
          if (x != prev) s[i] = x;
        }
      } else {
        if (s[i] == '?') {
          prev = s[i - 1];
          next = s[i + 1];
          if (prev == '?') {
            for (auto x : abc) {
              if (x != next) s[i] = x;
            }
          } else if (next == '?') {
            for (auto x : abc) {
              if (x != prev) s[i] = x;
            }
          } else if (prev != '?' && next != '?') {
            for (auto x : abc) {
              if (x != prev && x != next) s[i] = x;
            }
          }
        }
      }
    }
    bool flag = true;
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == s[i + 1]) {
        cout << "-1" << endl;
        flag = false;
        break;
      }
    }
    if (flag) cout << s << endl;
  }
  return 0;
}
