#include <bits/stdc++.h>
using namespace std;
char remove_conflict(char a, char b) {
  if (a == b)
    return ((a != 'a') ? 'a' : 'b');
  else {
    if ((a == 'a' && b == 'b') || (a == 'b' && b == 'a'))
      return 'c';
    else if ((a == 'b' && b == 'c') || (a == 'c' && b == 'b'))
      return 'a';
    else
      return 'b';
  }
}
int main() {
  int t;
  string str;
  cin >> t;
  while (t--) {
    char b_char = 'a', a_char = 'a';
    int i, j = 0, size;
    cin >> str;
    size = str.length();
    for (i = 0; i < size; i++) {
      if (i != size - 1 && str[i] != '?' && str[i + 1] != '?' &&
          str[i] == str[i + 1])
        break;
      if (str[i] != '?') b_char = str[i];
      a_char = remove_conflict(b_char, a_char);
      j = 0;
      while (i + j < size && str[j + i] == '?') {
        if (j % 2 == 0)
          str[i + j] = a_char;
        else
          str[i + j] = b_char;
        j++;
      }
      if (j != 0) i += j - 1;
      if (i != size - 1 && str[i] == str[i + 1]) {
        str[i] = remove_conflict((i != 0) ? str[i - 1] : str[i], str[i]);
      }
    }
    if (i == size)
      cout << str << "\n";
    else
      cout << "-1\n";
  }
  return 0;
}
