#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MOD = 1000000007;
const int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
char f(char a, char b) {
  for (char c = 'a'; c <= 'c'; c++)
    if (c != a && c != b) return c;
  return 'a';
}
signed main() {
  cin.tie(0), cout.tie(0);
  ios::sync_with_stdio(0);
  int q;
  cin >> q;
  while (q--) {
    string s;
    cin >> s;
    int n = s.length();
    for (int i = 0; i < n; i++)
      if (s[i] == '?')
        s[i] = f((i == 0) ? '?' : s[i - 1], (i == n - 1) ? '?' : s[i + 1]);
    bool valid = true;
    for (int i = 1; i < s.length(); i++)
      if (s[i] == s[i - 1]) valid = false;
    if (valid)
      cout << s << "\n";
    else
      cout << "-1"
           << "\n";
  }
  return 0;
}
