for _ in range(int(input())):
    s = list(input())
    l1 = ['a', 'b', 'c']
    ans = 1
    if s[0] == '?':
        for i in l1:
            if i != s[1]:
                s[0] = i
                break
    for i in range(1, len(s) - 1):
        if s[i] == '?':
            for j in l1:
                if j != s[i - 1] and j != s[i + 1]:
                    s[i] = j
                    break
        else:
            if s[i] == s[i - 1] or s[i] == s[i + 1]:
                ans = -1
    if s[-1] == '?':
        for i in l1:
            if i != s[-2]:
                s[-1] = i
                break
    if ans == 1:
        print(''.join(s))
    else:
        print(ans)
