#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = 0;
  while (!isdigit(c)) {
    if (c == '-') flag = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  x = flag ? -x : x;
}
template <class T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 1e5 + 10;
const double eps = 1e-6;
string s;
char get(int i) {
  for (char c = 'a'; c <= 'c'; ++c) {
    if (i != 0 && c == s[i - 1]) continue;
    if (i != s.length() - 1 && c == s[i + 1]) continue;
    return c;
  }
  return '?';
}
int main() {
  int t;
  read(t);
  while (t--) {
    cin >> s;
    bool flag = 1;
    for (int i = 0; i < s.length(); ++i) {
      if (s[i] == '?') {
        s[i] = get(i);
      }
      if (i != 0 && s[i] == s[i - 1]) {
        flag = 0;
        break;
      }
    }
    if (!flag)
      puts("-1");
    else {
      cout << s << '\n';
    }
  }
}
