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