#include <bits/stdc++.h>
using namespace std;
int t;
string str;
char ch[10] = {'a', 'b', 'c'};
void check(int i) {
  if (i == 0) {
    int index = 0;
    while (ch[index] == str[i + 1]) {
      index++;
      if (index >= 3) break;
    }
    str[i] = ch[index];
  } else if (i == str.length() - 1) {
    int index = 0;
    while (ch[index] == str[i - 1]) {
      index++;
      if (index >= 3) break;
    }
    str[i] = ch[index];
  } else {
    int index = 0;
    while (ch[index] == str[i - 1] || ch[index] == str[i + 1]) {
      index++;
      if (index >= 3) break;
    }
    str[i] = ch[index];
  }
}
int main() {
  scanf("%d", &t);
  for (int kk = 1; kk <= t; kk++) {
    cin >> str;
    bool f = false;
    for (int i = 0; i < str.length(); i++) {
      if (i != str.length() - 1 && str[i] == str[i + 1] && str[i] != '?') {
        f = true;
        break;
      }
      if (str[i] == '?') {
        check(i);
      }
    }
    if (f)
      puts("-1");
    else
      cout << str << endl;
  }
  return 0;
}
