#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int j;
  vector<string> ans;
  for (j = 0; j < t; j++) {
    string str;
    cin >> str;
    int i;
    int flag = 0;
    if (str.size() != 1)
      for (i = 0; i < str.size() - 1; i++) {
        if (str[i] != '?' && str[i] == str[i + 1]) {
          ans.push_back("-1");
          flag = 1;
          break;
        }
      }
    if (flag == 1) continue;
    if (str.size() == 1)
      ans.push_back("a");
    else {
      for (i = 0; i < str.size(); i++) {
        if (str[i] == '?') {
          if (i == 0) {
            if ('a' != str[i + 1])
              str[i] = 'a';
            else
              str[i] = 'b';
          } else if (i == str.size() - 1) {
            if ('a' != str[i - 1])
              str[i] = 'a';
            else
              str[i] = 'b';
          } else {
            if ('a' != str[i + 1] && 'a' != str[i - 1])
              str[i] = 'a';
            else if ('b' != str[i + 1] && 'b' != str[i - 1])
              str[i] = 'b';
            else
              str[i] = 'c';
          }
        }
      }
      ans.push_back(str);
    }
  }
  for (j = 0; j < ans.size(); j++) cout << ans[j] << endl;
  return 0;
}
