#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string str;
    cin >> str;
    bool ok = true;
    for (int j = 0; j < str.size() - 1; ++j) {
      if (str[j] != '?' && str[j] == str[j + 1]) {
        ok = false;
        break;
      }
    }
    if (!ok) {
      cout << -1 << endl;
      continue;
    }
    for (int j = 0; j < str.size(); ++j) {
      if (str[j] == '?') {
        for (char c = 'a'; c <= 'c'; ++c) {
          if ((j == 0 || str[j - 1] != c) &&
              (j == str.size() - 1 || str[j + 1] != c)) {
            str[j] = c;
            break;
          }
        }
      }
    }
    cout << str << endl;
  }
}
