import java.util.Scanner;

public class pa {
    public static void  main(String[] args ){

        Scanner input = new Scanner(System. in);
    try {
        int number = Integer.parseInt(input.nextLine());
        if(number>0 & number<=1000){
            String argument[] = new String[ (int)number];
            for (int    i = 0; i < number; i++) {
                String a = input.nextLine();
                argument[i]=a;
            }
            for (int j = 0; j <number ; j++) {
                check(argument[j]);
            }
        }

    }
    catch (Exception e){

    }





    }
    public static void check(String test1){
        String beutiful="";
        boolean status=false;
        String[] test = test1.split("");
        for (int i = 0; i <test.length ; i++) {

            if(i==0 & !test[i].equalsIgnoreCase("?")){
                if( test[i].equalsIgnoreCase(test[i+1])){
                    status= true;
                    break;
                }
            }
            if(i==test.length-1 &!test[i].equalsIgnoreCase("?")){
                if(test[i].equalsIgnoreCase(test[i-1])){
                    status= true;
                    break;
                }
            }
            if(i!=0 & i != test.length-1 &!test[i].equalsIgnoreCase("?")){
                if(test[i].equalsIgnoreCase(test[i-1]) | test[i].equalsIgnoreCase(test[i+1]) ){
                    status= true;
                    break;
                }
            }


            if(test[i].equalsIgnoreCase("?")){
                if(i==0){
                    if(!test[i+1].equalsIgnoreCase("a")){

                        test[i]="a";
                        beutiful+='a';

                    }
                    else if( !test[i+1].equalsIgnoreCase("b")){

                        test[i]="b";
                        beutiful+='b';

                    }
                    else if(!test[i+1].equalsIgnoreCase("c")){

                        test[i]="c";
                        beutiful+='c';

                    }

                }
                if(i == test.length-1){
                    if(!test[i-1].equalsIgnoreCase("a")){

                        test[i]="a";
                        beutiful+='a';

                    }
                    else if( !test[i-1].equalsIgnoreCase("b")){

                        test[i]="b";
                        beutiful+='b';

                    }
                    else if(!test[i-1].equalsIgnoreCase("c")){

                        test[i]="c";
                        beutiful+='c';

                    }
                }
                if(i!=0 & i != test.length-1){
                    if(!test[i-1].equalsIgnoreCase("a") & !test[i+1].equalsIgnoreCase("a")){

                        test[i]="a";
                        beutiful+='a';

                    }
                    else if(!test[i-1].equalsIgnoreCase("b") & !test[i+1].equalsIgnoreCase("b")){

                        test[i]="b";
                        beutiful+='b';

                    }
                    else if(!test[i-1].equalsIgnoreCase("c") & !test[i+1].equalsIgnoreCase("c")){

                        test[i]="c";
                        beutiful+='c';

                    }

                }


            }
            else {
                beutiful+=test[i];
            }
        }

        if(status==true){
            beutiful="-1";
        }
        System.out.println(beutiful);
    }

}

