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