#include <bits/stdc++.h>
using namespace std;
void MAZEN() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  MAZEN();
  int t;
  cin >> t;
  while (t--) {
    string x;
    cin >> x;
    if (x[0] == '?') {
      if (x[1] != 'a')
        x[0] = 'a';
      else
        x[0] = 'b';
    }
    for (int i = 1; i < x.size() - 1; i++) {
      if (x[i] == '?') {
        if (x[i + 1] != 'a' && x[i - 1] != 'a')
          x[i] = 'a';
        else if (x[i + 1] != 'b' && x[i - 1] != 'b')
          x[i] = 'b';
        else if (x[i + 1] != 'c' && x[i - 1] != 'c')
          x[i] = 'c';
      }
    }
    if (x[x.size() - 1] == '?') {
      if (x[x.size() - 2] != 'a')
        x[x.size() - 1] = 'a';
      else if (x[x.size() - 2] != 'b')
        x[x.size() - 1] = 'b';
      else if (x[x.size() - 2] != 'c')
        x[x.size() - 1] = 'c';
    }
    for (int i = 1; i < x.size(); i++)
      if (x[i] == x[i - 1]) {
        cout << "-1" << endl;
        goto ss;
      }
    cout << x << endl;
  ss:;
  }
  return 0;
}
