#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string inp;
    cin >> inp;
    bool flag = true;
    for (int i = 1; i < inp.size(); i++) {
      if (inp[i] == inp[i - 1] and inp[i] != '?') {
        flag = false;
      }
    }
    for (int i = 0; i < inp.size(); i++) {
      if (inp[i] == '?') {
        char c = 'a';
        if (i - 1 >= 0) {
          if (inp[i - 1] == 'a') c = 'b';
        }
        if (i + 1 < inp.size()) {
          if (inp[i + 1] == 'b' and c == 'b') {
            if (inp[i - 1] == 'a')
              c = 'c';
            else
              c = 'a';
          }
          if (inp[i + 1] == 'a' and c == 'a') {
            if (inp[i - 1] == 'b')
              c = 'c';
            else
              c = 'b';
          }
          if (inp[i + 1] == 'c' and c == 'c') {
            if (inp[i - 1] == 'a')
              c = 'b';
            else
              c = 'a';
          }
        }
        inp[i] = c;
      }
    }
    if (flag)
      cout << inp << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
