#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    bool f = true;
    for (int i = 0; i < s.size() - 1; i++) {
      if (s[i] != '?' && s[i + 1] != '?') {
        if (s[i] == s[i + 1]) {
          f = false;
          break;
        }
      }
    }
    if (!f) {
      cout << -1 << endl;
      continue;
    }
    string ans = "";
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '?') {
        char ch = 'a';
        if (ans.size() == 0) {
          if (i + 1 < n) {
            if (s[i + 1] == ch) ch++;
          }
          ans += ch;
        } else if (i + 1 == s.size()) {
          if (ans[i - 1] == ch) ch++;
          ans += ch;
        } else {
          if (ans[i - 1] != 'a' && s[i + 1] != 'a')
            ans += 'a';
          else if (ans[i - 1] != 'b' && s[i + 1] != 'b')
            ans += 'b';
          else if (ans[i - 1] != 'c' && s[i + 1] != 'c')
            ans += 'c';
        }
      } else
        ans += s[i];
    }
    cout << ans << endl;
  }
  return 0;
}
