#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  string s;
  while (t--) {
    cin >> s;
    for (long long i = 0; i < (long long)(s.size()); i++) {
      if (s[i] == '?') {
        set<char> temp;
        if (i != 0) temp.insert(s[i - 1]);
        if (i != (long long)(s.size()) - 1 && s[i + 1] != '?')
          temp.insert(s[i + 1]);
        for (long long j = 0; j < 3; j++) {
          if (temp.find('a' + j) == temp.end()) {
            s[i] = 'a' + j;
            break;
          }
        }
      }
    }
    long long f = 0;
    for (long long i = 0; i < (long long)(s.size()); i++) {
      if (i != 0 && s[i] == s[i - 1]) f = 1;
      if (i != (long long)(s.size()) - 1 && s[i] == s[i + 1]) f = 1;
    }
    if (f == 0)
      cout << s << '\n';
    else
      cout << -1 << '\n';
  }
  return 0;
}
