#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[1000];
  int n, i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < s[i].length(); j++) {
      if (s[i][j] == '?') {
        if (s[i][0] == '?' && s[i].length() == 1) {
          s[i] = "a";
        }
        if (j == 0) {
          if (s[i][j + 1] == '?') {
            s[i][j] = 'a';
          }
          if (s[i][j + 1] == 'a') {
            s[i][j] = 'b';
          }
          if (s[i][j + 1] == 'b') {
            s[i][j] = 'c';
          }
          if (s[i][j + 1] == 'c') {
            s[i][j] = 'a';
          }
        } else {
          if (j == s[i].length() - 1) {
            if (s[i][j - 1] == '?') {
              s[i][j] = 'a';
            }
            if (s[i][j - 1] == 'a') {
              s[i][j] = 'b';
            }
            if (s[i][j - 1] == 'b') {
              s[i][j] = 'c';
            }
            if (s[i][j - 1] == 'c') {
              s[i][j] = 'a';
            }
          } else {
            if (s[i][j - 1] == 'a') {
              if (s[i][j + 1] == '?') {
                s[i][j] = 'b';
              }
              if (s[i][j + 1] == 'a') {
                s[i][j] = 'b';
              }
              if (s[i][j + 1] == 'b') {
                s[i][j] = 'c';
              }
              if (s[i][j + 1] == 'c') {
                s[i][j] = 'b';
              }
            }
            if (s[i][j - 1] == 'b') {
              if (s[i][j + 1] == '?') {
                s[i][j] = 'c';
              }
              if (s[i][j + 1] == 'a') {
                s[i][j] = 'c';
              }
              if (s[i][j + 1] == 'b') {
                s[i][j] = 'c';
              }
              if (s[i][j + 1] == 'c') {
                s[i][j] = 'a';
              }
            }
            if (s[i][j - 1] == 'c') {
              if (s[i][j + 1] == '?') {
                s[i][j] = 'a';
              }
              if (s[i][j + 1] == 'a') {
                s[i][j] = 'b';
              }
              if (s[i][j + 1] == 'b') {
                s[i][j] = 'a';
              }
              if (s[i][j + 1] == 'c') {
                s[i][j] = 'b';
              }
            }
          }
        }
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 1; j < s[i].length(); j++) {
      if (s[i][j] == s[i][j - 1]) {
        s[i] = "-1";
        break;
      }
    }
  }
  for (i = 0; i < n; i++) {
    cout << s[i] << endl;
  }
  return 0;
}
