#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  while (t--) {
    char arr[3] = {'a', 'b', 'c'};
    int idx[256];
    idx['a'] = 0, idx['b'] = 1, idx['c'] = 2;
    string s;
    cin >> s;
    int len = s.size();
    bool valid = true;
    for (int i = 0; i < len - 1; ++i) {
      if (s[i] == '?') continue;
      if (s[i] == s[i + 1]) valid = false;
    }
    if (!valid) {
      cout << -1 << '\n';
      continue;
    }
    for (int i = 0; i < len; ++i) {
      if (s[i] == '?') {
        for (int j = 0; j < 3; ++j) {
          if ((i - 1 < 0 || arr[j] != s[i - 1]) &&
              (i + 1 >= len || arr[j] != s[i + 1])) {
            s[i] = arr[j];
            break;
          }
        }
      }
      cout << s[i];
    }
    cout << '\n';
  }
  return 0;
}
