#include <bits/stdc++.h>
using namespace std;
long long INF = static_cast<long long>(2e18);
int inf = static_cast<int>(1e9 + 7);
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  string s;
  for (int k = 0; k < t; ++k) {
    cin >> s;
    int size = s.size();
    if (size == 1) {
      cout << "a" << endl;
      continue;
    }
    for (int i = 0; i < size; ++i) {
      if (s[i] == '?') {
        if (i == 0) {
          if (s[i + 1] == 'a') {
            s[i] = 'b';
            continue;
          }
          if (s[i + 1] == 'b') {
            s[i] = 'c';
            continue;
          }
          if (s[i + 1] == 'c') {
            s[i] = 'a';
            continue;
          }
          s[i] = 'a';
          continue;
        }
        if (i == size - 1) {
          if (s[i - 1] == 'a') {
            s[i] = 'b';
            continue;
          }
          if (s[i - 1] == 'b') {
            s[i] = 'c';
            continue;
          }
          if (s[i - 1] == 'c') {
            s[i] = 'a';
            continue;
          }
        }
        if (s[i - 1] == 'a') {
          if (s[i + 1] == 'a') {
            s[i] = 'b';
            continue;
          }
          if (s[i + 1] == 'b') {
            s[i] = 'c';
            continue;
          }
          if (s[i + 1] == 'c') {
            s[i] = 'b';
            continue;
          }
          s[i] = 'b';
          continue;
        }
        if (s[i - 1] == 'b') {
          if (s[i + 1] == 'a') {
            s[i] = 'c';
            continue;
          }
          if (s[i + 1] == 'b') {
            s[i] = 'c';
            continue;
          }
          if (s[i + 1] == 'c') {
            s[i] = 'a';
            continue;
          }
          s[i] = 'c';
          continue;
        }
        if (s[i - 1] == 'c') {
          if (s[i + 1] == 'a') {
            s[i] = 'b';
            continue;
          }
          if (s[i + 1] == 'b') {
            s[i] = 'a';
            continue;
          }
          if (s[i + 1] == 'c') {
            s[i] = 'a';
            continue;
          }
          s[i] = 'a';
          continue;
        }
      }
    }
    bool fl = true;
    for (int i = 0; i < size - 1; ++i) {
      if (s[i] == s[i + 1]) {
        fl = false;
        break;
      }
    }
    if (fl == false) {
      cout << "-1" << endl;
      continue;
    }
    cout << s << endl;
  }
}
