#include <bits/stdc++.h>
using namespace std;
char change(char a, char b) {
  if (a > b) swap(a, b);
  if (a == 'a' and b == 'c')
    return 'b';
  else if (a == '?' and b == 'a')
    return 'b';
  else if (a == '?' and b == 'b')
    return 'c';
  else if (a == '?' and b == 'c')
    return 'a';
  else if (a == 'b' and b == 'c')
    return 'a';
  else if (a == 'a' and b == 'b')
    return 'c';
  else if (a == b and a == 'a')
    return 'b';
  else if (a == b and a == 'b')
    return 'c';
  else if (a == b and a == 'c')
    return 'a';
}
bool check_string(string s) {
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == '?')
      continue;
    else {
      if (s[i] == s[i + 1]) return false;
    }
  }
  return true;
}
void make_string(string &a) {
  if (a.size() == 1 and a[0] == '?') a[0] = 'a';
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == '?') {
      if (i == 0) {
        if (a[i + 1] == 'a')
          a[i] = 'b';
        else if (a[i + 1] == 'b')
          a[i] = 'c';
        else if (a[i + 1] == 'c')
          a[i] = 'a';
        else if (a[i + 1] == '?')
          a[i] = 'a';
      } else if (i == (a.size() - 1)) {
        if (a[i - 1] == 'a')
          a[i] = 'b';
        else if (a[i - 1] == 'b')
          a[i] = 'c';
        else if (a[i - 1] == 'c')
          a[i] = 'a';
      } else {
        a[i] = change(a[i - 1], a[i + 1]);
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (check_string(s))
      make_string(s), cout << s << endl;
    else
      cout << -1 << endl;
  }
}
