#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int flag = 0;
    for (int i = 0; i < s.length() - 1; i++) {
      if (s[i] != '?' && s[i] == s[i + 1]) {
        flag = 1;
        break;
      }
    }
    if (flag) {
      cout << -1 << "\n";
      continue;
    }
    for (int i = 0; i < s.length(); i++) {
      if (i == 0 && s[0] == '?') {
        if (s[1] == 'a') {
          s[0] = 'b';
        } else if (s[1] == 'b') {
          s[0] = 'c';
        } else if (s[1] == 'c') {
          s[0] = 'a';
        }
      }
      if (s[i] == '?') {
        if (s[i - 1] != 'a' && s[i + 1] != 'a') {
          s[i] = 'a';
        } else if (s[i - 1] != 'b' && s[i + 1] != 'b') {
          s[i] = 'b';
        } else if (s[i - 1] != 'c' && s[i + 1] != 'c') {
          s[i] = 'c';
        }
      }
    }
    cout << s << "\n";
  }
  return 0;
}
