#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n;
  while (n--) {
    cin >> s;
    int size = s.size();
    if (size == 1) {
      cout << "a" << endl;
      continue;
    }
    if (s.find("aa") != -1 || s.find("bb") != -1 || s.find("cc") != -1) {
      cout << -1 << endl;
      continue;
    }
    if (s[0] == '?') {
      if (s[1] == '?')
        s[0] = 'a';
      else if (s[1] == 'a')
        s[0] = 'b';
      else if (s[1] == 'b')
        s[0] = 'a';
      else if (s[1] == 'c')
        s[0] = 'b';
    }
    for (int i = 1; i < s.size() - 1; i++) {
      if (s[i] == '?') {
        if (s[i - 1] == 'a') {
          if (s[i + 1] == '?')
            s[i] = 'b';
          else if (s[i + 1] == 'a')
            s[i] = 'b';
          else if (s[i + 1] == 'b')
            s[i] = 'c';
          else if (s[i + 1] == 'c')
            s[i] = 'b';
        } else if (s[i - 1] == 'b') {
          if (s[i + 1] == '?')
            s[i] = 'c';
          else if (s[i + 1] == 'a')
            s[i] = 'c';
          else if (s[i + 1] == 'b')
            s[i] = 'a';
          else if (s[i + 1] == 'c')
            s[i] = 'a';
        } else if (s[i - 1] == 'c') {
          if (s[i + 1] == '?')
            s[i] = 'a';
          else if (s[i + 1] == 'a')
            s[i] = 'b';
          else if (s[i + 1] == 'b')
            s[i] = 'a';
          else if (s[i + 1] == 'c')
            s[i] = 'a';
        }
      }
    }
    if (s[size - 1] == '?') {
      if (s[size - 2] == '?')
        s[0] = 'a';
      else if (s[size - 2] == 'a')
        s[size - 1] = 'b';
      else if (s[size - 2] == 'b')
        s[size - 1] = 'a';
      else if (s[size - 2] == 'c')
        s[size - 1] = 'b';
    }
    if (s.find("aa") != -1 || s.find("bb") != -1 || s.find("cc") != -1) {
      cout << -1 << endl;
      continue;
    } else {
      cout << s << endl;
    }
  }
  int aa;
  cin >> aa;
  return 0;
}
