#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int _ = 1;
  cin >> _;
  while (_--) {
    long long int n, y, m, ans = 1;
    char c[3] = {'a', 'b', 'c'};
    string s;
    cin >> s;
    n = s.size();
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == s[i + 1] && s[i] != '?') ans = 0;
    }
    if (!ans) {
      cout << "-1\n";
      continue;
    }
    for (int i = 0; i < n; i++) {
      if (s[i] != '?') continue;
      int j = 0;
      bool d = 1;
      for (; j < 3; j++) {
        d = 1;
        if (i > 0 && s[i - 1] == c[j]) d = 0;
        if (i < n - 1 && s[i + 1] == c[j]) d = 0;
        if (d) {
          break;
        }
      }
      s[i] = c[j];
    }
    cout << s << "\n";
  }
  return 0;
}
