import java.io.*;
import java.util.*;

final public class A {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        char[] req = "abacaba".toCharArray();
        int tst = Integer.parseInt(br.readLine());
        while(tst-->0){
            int n = Integer.parseInt(br.readLine());
            char[] arr = br.readLine().toCharArray();
            //all pos with substring occurrence
            ArrayList<Integer> lst = new ArrayList<>();
            boolean poss = true;
            for(int i = 0; i+6<n; i++){
                poss = true;
                for(int j = 0; j<7; j++){
                    if(arr[i+j]!=req[j] && arr[i+j]!='?'){
                        poss = false;
                        break;
                    }
                }
                if(poss) lst.add(i);
            }
            if(lst.size() == 0){
                sb.append("No").append('\n');
                continue;
            }
            boolean done = false;
            for(int z: lst){
                char[] ans = new char[n];
                System.arraycopy(arr, 0, ans, 0, n);
                for(int x = 0; x<7; x++){
                    ans[z+x] = req[x];
                }
                int occ = 0;
                for(int i = 0; i+6<n; i++){
                    poss = true;
                    for(int j = 0; j<7; j++){
                        if(ans[i+j]!=req[j]){
                            poss = false;
                            break;
                        }
                    }
                    if(poss) occ++;
                }
                if(occ == 1){
                    for(int i = 0; i<n; i++){
                        if(ans[i] == '?') ans[i] = 'z';
                    }
                    sb.append("Yes").append('\n');
                    sb.append(ans).append('\n');
                    done = true;
                    break;
                }
            }
            if(!done) sb.append("No").append('\n');
        }
        System.out.println(sb);
    }
}


import java.io.*;
import java.util.*;

public class A {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int tst = Integer.parseInt(br.readLine());
        char[] ref = "abacaba".toCharArray();
        while(tst-->0){
            int n = Integer.parseInt(br.readLine());
            char[] arr = br.readLine().toCharArray();
            boolean is_fixed = false;
            int fixed_occ = 0;
            for(int i = 0; i+6<n; i++){
                boolean fixed = true;
                for(int j = 0; j<7; j++){
                    if(ref[j] != arr[i+j]){
                        fixed = false;
                        break;
                    }
                }
                if(fixed){
                    fixed_occ++;
                    is_fixed = true;
                }
            }
            boolean added = false;
            int st = -1;
            for(int i = 0; i+6<n; i++){
                boolean poss = false;
                for(int j = 0; j<7; j++){
                    if(arr[i+j] == ref[j] || arr[i+j] == '?'){
                        poss = true;
                    }
                    else{
                        poss = false;
                        break;
                    }
                }
                if(poss){
                    st = i;
                    added = true;
                    break;
                }
            }
            if(is_fixed && fixed_occ == 1){
                sb.append("Yes").append('\n');
                for(char x: arr){
                    if(x == '?') sb.append('z');
                    else sb.append(x);
                }
                sb.append('\n');
            }
            else if(added && !is_fixed){
                sb.append("Yes").append('\n');
                for(int i =0; i<n; i++){
                    if(i!=st){
                        if(arr[i] == '?') sb.append('z');
                        else sb.append(arr[i]);
                    }
                    if(i == st){
                        for(int j = 0; j<7; j++){
                            sb.append(ref[j]);
                        }
                        i+=7;
                    }
                }
                sb.append('\n');
            }
            else sb.append("No").append('\n');
        }
        System.out.println(sb);
    }
}


import java.io.*;
import java.util.*;

final public class A {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        char[] req = "abacaba".toCharArray();
        int tst = Integer.parseInt(br.readLine());
        while(tst-->0){
            int n = Integer.parseInt(br.readLine());
            char[] arr = br.readLine().toCharArray();
            //if already occurring
            boolean poss = true;
            int occ = 0;
            for(int i = 0; i+6<arr.length; i++){
                poss = true;
                for(int j = 0; j<7; j++){
                    if(req[j]!=arr[i+j]){
                        poss = false;
                        break;
                    }
                }
                if(poss) occ++;
            }
            if(poss && occ == 1){
                sb.append("Yes").append('\n');
                for(char c: arr){
                    if(c == '?') sb.append('z');
                    else sb.append(c);
                }
                sb.append('\n');
            }
            //if not occurring
            else{
                for(int i = 0; i+6<arr.length; i++){
                    poss = true;
                    for(int j = 0; j<7; j++){
                        if(req[j]!=arr[i+j] && arr[i+j]!='?'){
                            poss = false;
                            break;
                        }
                    }
                    if(poss){
                        for(int j = 0; j<7; j++){
                            arr[i+j] = req[j];
                        }
                        break;
                    }
                }
                if(poss){
                    occ = 0;
                    for(int i = 0; i+6<arr.length; i++){
                        poss = true;
                        for(int j = 0; j<7; j++){
                            if(arr[i+j]!=req[j]){
                                poss = false;
                                break;
                            }
                        }
                        if(poss) occ++;
                    }
                    if(occ == 1) {
                        System.err.println("done");
                        sb.append("Yes").append('\n');
                        for(char c: arr) {
                            if(c == '?') sb.append('z');
                            else sb.append(c);
                        }
                        sb.append('\n');
                    }
                    else sb.append("No").append('\n');
                }
                else{
                    sb.append("No").append('\n');
                }
            }
        }
        System.out.println(sb);
    }
}


import java.io.*;
import java.util.*;

public class A {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int tst = Integer.parseInt(br.readLine());
        char[] ref = "abacaba".toCharArray();
        while(tst-->0){
            int n = Integer.parseInt(br.readLine());
            char[] arr = br.readLine().toCharArray();
            boolean is_fixed = false;
            int fixed_occ = 0;
            for(int i = 0; i+6<n; i++){
                boolean fixed = true;
                for(int j = 0; j<7; j++){
                    if(ref[j] != arr[i+j]){
                        fixed = false;
                        break;
                    }
                }
                if(fixed){
                    fixed_occ++;
                    is_fixed = true;
                }
            }
            boolean added = false;
            int st = -1;
            for(int i = 0; i+6<n; i++){
                boolean poss = false;
                for(int j = 0; j<7; j++){
                    if(arr[i+j] == ref[j] || arr[i+j] == '?'){
                        poss = true;
                    }
                    else{
                        poss = false;
                        break;
                    }
                }
                if(poss){
                    st = i;
                    added = true;
                    break;
                }
            }
            if(is_fixed && fixed_occ == 1){
                sb.append("Yes").append('\n');
                for(char x: arr){
                    if(x == '?') sb.append('z');
                    else sb.append(x);
                }
                sb.append('\n');
            }
            else if(added && !is_fixed){
                sb.append("Yes").append('\n');
                for(int i =0; i<n; i++){
                    if(i!=st){
                        if(arr[i] == '?') sb.append('z');
                        else sb.append(arr[i]);
                    }
                    if(i == st){
                        for(int j = 0; j<7; j++){
                            sb.append(ref[j]);
                        }
                        i+=6;
                    }
                }
                sb.append('\n');
            }
            else sb.append("No").append('\n');
        }
        System.out.println(sb);
    }
}
//hfppoyeteeqfabacabahjkrjdwadaddbapnghixkweft


import java.io.*;
import java.util.*;

final public class A {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        char[] req = "abacaba".toCharArray();
        int tst = Integer.parseInt(br.readLine());
        while(tst-->0){
            int n = Integer.parseInt(br.readLine());
            char[] arr = br.readLine().toCharArray();
            //if already occurring
            boolean poss = true;
            int occ = 0;
            for(int i = 0; i+6<arr.length; i++){
                poss = true;
                for(int j = 0; j<7; j++){
                    if(req[j]!=arr[i+j]){
                        poss = false;
                        break;
                    }
                }
                if(poss) occ++;
            }
            if(poss && occ == 1){
                sb.append("Yes").append('\n');
                for(char c: arr){
                    if(c == '?') sb.append('z');
                    else sb.append(c);
                }
                sb.append('\n');
            }
            //if not occurring
            else{
                for(int i = 0; i<arr.length; i++){
                    poss = true;
                    for(int j = 0; j<7; j++){
                        if(req[j]!=arr[i+j] && arr[i+j]!='?'){
                            poss = false;
                            break;
                        }
                    }
                    if(poss){
                        for(int j = 0; j<7; j++){
                            arr[i+j] = req[j];
                        }
                        break;
                    }
                }
                if(poss){
                    occ = 0;
                    for(int i = 0; i+6<arr.length; i++){
                        poss = true;
                        for(int j = 0; j<7; j++){
                            if(arr[i+j]!=req[j]){
                                poss = false;
                                break;
                            }
                        }
                        if(poss) occ++;
                    }
                    if(occ == 1) {
                        System.err.println("done");
                        sb.append("Yes").append('\n');
                        for(char c: arr) {
                            if(c == '?') sb.append('z');
                            else sb.append(c);
                        }
                        sb.append('\n');
                    }
                    else sb.append("No").append('\n');
                }
                else{
                    sb.append("No").append('\n');
                }
            }
        }
        System.out.println(sb);
    }
}


// Spaghetti code
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static class FastReader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String next(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(next()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public void scanIntArr(int [] arr){ for(int li=0;li<arr.length;++li)arr[li]=i();}
        public void scanIntIndexArr(int [] arr){ for(int li=0;li<arr.length;++li){ arr[li]=i()-1;}}
        public void printIntArr(int [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void printLongArr(long [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void scanLongArr(long [] arr){for (int i=0;i<arr.length;++i){arr[i]=l();}}
        public void shuffle(int [] arr){ for(int i=arr.length;i>0;--i) { int r=(int)(Math.random()*i); int temp=arr[i-1]; arr[i-1]=arr[r]; arr[r]=temp; }}
        public int findMax(int [] arr){return Arrays.stream(arr).max().getAsInt();}
    }

    public static void main(String[] args) throws IOException {
        FastReader fr = new FastReader();
        pw = new PrintWriter(System.out);

        /*
inputCopy
6
8
?abacaba
7
???????
11
aba?abacaba
11
abacaba?aba
15
asdf???f???qwer
11
abacabacaba
outputCopy
Yes
abacaba
Yes
abacaba
Yes
abadabacaba
Yes
abacabadaba
No
No

2
10
aba?bacaba
11
aba?a?acaba

         */

        int t = fr.i();
        for (int ti = 0; ti < t; ++ti) {

            int n=fr.i();
            String str=fr.nextLine();
            char [] ans=str.toCharArray();
            int index1=str.indexOf("abacaba");
            int index2=str.indexOf("abacaba",index1+4);
            boolean solved=false;
            if(index1>-1 && index2>-1){
                pw.println("No");
                continue;
            }else if(index1>-1 && index2<0){
                solved=true;
            }else if(index1==-1){
                //System.err.println("Hi");
                char [] substr="abacaba".toCharArray();
                int j=0;
                for(int i=0;i<n-substr.length+1;++i){
                    if(canFit(str,i)){
                        char [] str2=str.toCharArray();
                        for(j=0;j<substr.length;++j)str2[i+j]=substr[j];
                        String str3=String.valueOf(str2);
                        if(str3.indexOf("abacaba",str3.indexOf("abacaba")+1)>=0)
                            continue;
                        for(j=0;j<substr.length;++j)ans[i+j]=substr[j];
                        solved=true;
                        break;
                    }
                }
            }
            if(solved){
                for(int i=0;i<n;++i)
                    if(ans[i]=='?')
                        ans[i]='d';
                pw.println("Yes");
                pw.println(String.valueOf(ans));
            }else{
                pw.println("No");
                //System.err.println(String.valueOf(ans));
            }
        }
        pw.flush();
        pw.close();
    }

    private static boolean canFit(String str, int i) {
        String toSearch="abacaba";
        for(int j=0;j<toSearch.length();++j){
            if(str.charAt(i+j)==toSearch.charAt(j) || str.charAt(i+j)=='?')
                continue;
            else
                return false;
        }
        return true;
    }
}


// Spaghetti code
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static class FastReader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String next(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(next()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public void scanIntArr(int [] arr){ for(int li=0;li<arr.length;++li)arr[li]=i();}
        public void scanIntIndexArr(int [] arr){ for(int li=0;li<arr.length;++li){ arr[li]=i()-1;}}
        public void printIntArr(int [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void printLongArr(long [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void scanLongArr(long [] arr){for (int i=0;i<arr.length;++i){arr[i]=l();}}
        public void shuffle(int [] arr){ for(int i=arr.length;i>0;--i) { int r=(int)(Math.random()*i); int temp=arr[i-1]; arr[i-1]=arr[r]; arr[r]=temp; }}
        public int findMax(int [] arr){return Arrays.stream(arr).max().getAsInt();}
    }

    public static void main(String[] args) throws IOException {
        FastReader fr = new FastReader();
        pw = new PrintWriter(System.out);

        /*
inputCopy
6
8
?abacaba
7
???????
11
aba?abacaba
11
abacaba?aba
15
asdf???f???qwer
11
abacabacaba
outputCopy
Yes
abacaba
Yes
abacaba
Yes
abadabacaba
Yes
abacabadaba
No
No

1
8
?abacaba

         */

        int t = fr.i();
        for (int ti = 0; ti < t; ++ti) {

            int n=fr.i();
            String str=fr.nextLine();
            char [] ans=str.toCharArray();
            int index1=str.indexOf("abacaba");
            int index2=str.indexOf("abacaba",index1+4);
            boolean solved=false;
            if(index1>-1 && index2>-1){
                pw.println("No");
                continue;
            }else if(index1>-1 && index2<0){
                solved=true;
            }else if(index1==-1){
                char [] substr="abacaba".toCharArray();
                int j=0;
                for(int i=0;i<n;++i){
                    if(str.charAt(i)=='?'){
                        ans[i]=substr[j];
                        ++j;
                    }else if(str.charAt(i)==substr[j]){
                        ++j;
                    }else{
                        if(ans[i]=='a'){
                            j=1;
                        }else{
                            j=0;
                        }
                    }
                    if(j==substr.length){
                        solved=true;
                        break;
                    }
                }
            }
            if(solved){
                for(int i=0;i<n;++i)
                    if(ans[i]=='?')
                        ans[i]='d';
                pw.println("Yes");
                pw.println(String.valueOf(ans));
            }else{
                pw.println("No");
                //System.err.println(String.valueOf(ans));
            }
        }
        pw.flush();
        pw.close();
    }
}


// Spaghetti code
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static class FastReader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String next(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(next()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public void scanIntArr(int [] arr){ for(int li=0;li<arr.length;++li)arr[li]=i();}
        public void scanIntIndexArr(int [] arr){ for(int li=0;li<arr.length;++li){ arr[li]=i()-1;}}
        public void printIntArr(int [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void printLongArr(long [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void scanLongArr(long [] arr){for (int i=0;i<arr.length;++i){arr[i]=l();}}
        public void shuffle(int [] arr){ for(int i=arr.length;i>0;--i) { int r=(int)(Math.random()*i); int temp=arr[i-1]; arr[i-1]=arr[r]; arr[r]=temp; }}
        public int findMax(int [] arr){return Arrays.stream(arr).max().getAsInt();}
    }

    public static void main(String[] args) throws IOException {
        FastReader fr = new FastReader();
        pw = new PrintWriter(System.out);

        /*
inputCopy
6
8
?abacaba
7
???????
11
aba?abacaba
11
abacaba?aba
15
asdf???f???qwer
11
abacabacaba
outputCopy
Yes
abacaba
Yes
abacaba
Yes
abadabacaba
Yes
abacabadaba
No
No

1
10
aba?bacaba

         */

        int t = fr.i();
        for (int ti = 0; ti < t; ++ti) {

            int n=fr.i();
            String str=fr.nextLine();
            char [] ans=str.toCharArray();
            int index1=str.indexOf("abacaba");
            int index2=str.indexOf("abacaba",index1+4);
            boolean solved=false;
            if(index1>-1 && index2>-1){
                pw.println("No");
                continue;
            }else if(index1>-1 && index2<0){
                solved=true;
            }else if(index1==-1){
                //System.err.println("Hi");
                char [] substr="abacaba".toCharArray();
                int j=0;
                for(int i=0;i<n-substr.length+1;++i){
                    if(canFit(str,i)){
                        for(;j<substr.length;++j)ans[i+j]=substr[j];
                        solved=true;
                        break;
                    }
                }
            }
            if(solved){
                for(int i=0;i<n;++i)
                    if(ans[i]=='?')
                        ans[i]='d';
                pw.println("Yes");
                pw.println(String.valueOf(ans));
            }else{
                pw.println("No");
                //System.err.println(String.valueOf(ans));
            }
        }
        pw.flush();
        pw.close();
    }

    private static boolean canFit(String str, int i) {
        String toSearch="abacaba";
        for(int j=0;j<toSearch.length();++j){
            if(str.charAt(i+j)==toSearch.charAt(j) || str.charAt(i+j)=='?')
                continue;
            else
                return false;
        }
        return true;
    }
}


import java.util.*;
import java.io.*;
public class Solution{

    static class Pair<A, B> {

        A parent;
        B rank;

        Pair(A parent, B rank) {
            this.rank = rank;
            this.parent = parent;
        }
    }

    static class Node {
        int x;
        int y;
        Node(int k,int l)
        {
            x=k;y=l;
        }
    }
    static int m=1000000007;
    public static void main(String[] args) throws IOException {
        FastReader s1 = new FastReader();
        StringBuilder sb = new StringBuilder();
        int t=s1.I();
        while(t--!=0)
        {
            int n=s1.I();
            String patt = s1.next();
            String mat = "abacaba";
            int ans = ans(patt,mat);
//            System.out.println(ans+" ans");
            if(ans==2)
            {
                sb.append("NO\n");
                continue;
            }
            if(ans==1)
            {
                sb.append("YES\n");
                for(int i=0;i<patt.length();i++)
                {
                    if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                }
            }
            else
            {
                ans=match(patt,mat);
//                System.out.println("kkkkllll "+ans);
                if(ans==-1)
                {
                    sb.append("NO");
                }
                else
                {
                    sb.append("YES\n");
                    for(int i=0;i<ans;i++)
                    {
                        if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                    }
                    sb.append(mat);
                    for(int i=(ans+mat.length());i<patt.length();i++)
                    {
                        if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                    }
                }
            }
            sb.append("\n");
        }
        System.out.println(sb);
    }
    static int match(String patt,String mat)
    {
        int j=0;
        for(int i=0;i<patt.length();i++)
        {
            j=0;
            if(patt.charAt(i)==mat.charAt(j) || patt.charAt(i)=='?')
            {
                int k=i;
//                System.out.println(k+" kkk "+j+" "+patt.charAt(i));
                while(k<patt.length() && j<mat.length() && (patt.charAt(k)==mat.charAt(j) || patt.charAt(i)=='?'))
                {
                    k++;
                    j++;
//                    System.out.println(" inisde "+(k<patt.length())+" "+(j<mat.length())+" "+(patt.charAt(k)==mat.charAt(j))+" "+(patt.charAt(i)=='?'));
                }
//                System.out.println(k+" llll "+j);
                if(j==mat.length())
                {
                    return i;
                }
            }
        }
        return -1;
    }
    static int ans(String patt,String match)
    {
        int ind=patt.indexOf(match,0);
        int count=0;
        if(ind==-1)
            return count;
        count++;
        ind=patt.indexOf(match,ind+1);
        if(ind==-1)
        {
            return count;
        }
        return 2;
    }
    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int I() {
            return Integer.parseInt(next());
        }

        long L() {
            return Long.parseLong(next());
        }

        double D() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        }
        return gcd(b, a % b);
    }

    static float power(float x, int y) {
        float temp;
        if (y == 0) {
            return 1;
        }
        temp = power(x, y / 2);

        if (y % 2 == 0) {
            return temp * temp;
        } else {
            if (y > 0) {
                return x * temp * temp;
            } else {
                return (temp * temp) / x;
            }
        }
    }
    static long pow(long x, long y) {
        long res = 1;
        x = x % m;
        if (x < 0) {
            x += m;
        }
        while (y > 0) {
            if ((y & 1) == 1) {
                res = (res * x) % m;
                if (res < 0) {
                    res += m;
                }
            }
            y = y >> 1;
            x = (x * x) % m;
            if (x < 0) {
                x = x + m;
            }
        }
        res = res % m;
        if (res < 0) {
            res += m;
        }
        return res;
    }

    static void sieveOfEratosthenes(int n) {
        ArrayList<Integer> prime = new ArrayList<Integer>();
        boolean Prime[] = new boolean[n + 1];
        for (int i = 2; i < n; i++) {
            Prime[i] = true;
        }

        for (int p = 2; p * p <= n; p++) {
            if (Prime[p] == true) {
                prime.add(p);
                for (int i = p * p; i <= n; i += p) {
                    Prime[i] = false;
                }
            }
        }
    }
}


import java.util.*;
import java.io.*;
public class Solution{

    static class Pair<A, B> {

        A parent;
        B rank;

        Pair(A parent, B rank) {
            this.rank = rank;
            this.parent = parent;
        }
    }

    static class Node {
        int x;
        int y;
        Node(int k,int l)
        {
            x=k;y=l;
        }
    }
    static int m=1000000007;
    public static void main(String[] args) throws IOException {
        FastReader s1 = new FastReader();
        StringBuilder sb = new StringBuilder();
        int t=s1.I();
        while(t--!=0)
        {
            int n=s1.I();
            String patt = s1.next();
            String mat = "abacaba";
            int ans = ans(patt,mat);
//            System.out.println(ans+" ans");
            if(ans==2)
            {
                sb.append("NO\n");
                continue;
            }
            if(ans==1)
            {
                sb.append("YES\n");
                for(int i=0;i<patt.length();i++)
                {
                    if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                }
            }
            else
            {
                ans=match(patt,mat);
//                System.out.println("kkkkllll "+ans);
                if(ans==-1)
                {
                    sb.append("NO");
                }
                else
                {
                    sb.append("YES\n");
                    for(int i=0;i<ans;i++)
                    {
                        if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                    }
                    sb.append(mat);
                    for(int i=(ans+mat.length());i<patt.length();i++)
                    {
                        if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                    }
                }
            }
            sb.append("\n");
        }
        System.out.println(sb);
    }
    static int match(String patt,String mat)
    {
        int j=0;
        for(int i=0;i<patt.length();i++)
        {
            j=0;
            if(patt.charAt(i)==mat.charAt(j) || patt.charAt(i)=='?')
            {
                int k=i;
//                System.out.println(k+" kkk "+j+" "+patt.charAt(i));
                while(k<patt.length() && j<mat.length() && (patt.charAt(k)==mat.charAt(j) || patt.charAt(k)=='?'))
                {
                    k++;
                    j++;
//                    System.out.println(" inisde "+(k<patt.length())+" "+(j<mat.length())+" "+(patt.charAt(k)==mat.charAt(j))+" "+(patt.charAt(i)=='?'));
                }
//                System.out.println(k+" llll "+j);
                if(j==mat.length())
                {
                    return i;
                }
            }
        }
        return -1;
    }
    static int ans(String patt,String match)
    {
        int ind=patt.indexOf(match,0);
        int count=0;
        if(ind==-1)
            return count;
        count++;
        ind=patt.indexOf(match,ind+1);
        if(ind==-1)
        {
            return count;
        }
        return 2;
    }
    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int I() {
            return Integer.parseInt(next());
        }

        long L() {
            return Long.parseLong(next());
        }

        double D() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        }
        return gcd(b, a % b);
    }

    static float power(float x, int y) {
        float temp;
        if (y == 0) {
            return 1;
        }
        temp = power(x, y / 2);

        if (y % 2 == 0) {
            return temp * temp;
        } else {
            if (y > 0) {
                return x * temp * temp;
            } else {
                return (temp * temp) / x;
            }
        }
    }
    static long pow(long x, long y) {
        long res = 1;
        x = x % m;
        if (x < 0) {
            x += m;
        }
        while (y > 0) {
            if ((y & 1) == 1) {
                res = (res * x) % m;
                if (res < 0) {
                    res += m;
                }
            }
            y = y >> 1;
            x = (x * x) % m;
            if (x < 0) {
                x = x + m;
            }
        }
        res = res % m;
        if (res < 0) {
            res += m;
        }
        return res;
    }

    static void sieveOfEratosthenes(int n) {
        ArrayList<Integer> prime = new ArrayList<Integer>();
        boolean Prime[] = new boolean[n + 1];
        for (int i = 2; i < n; i++) {
            Prime[i] = true;
        }

        for (int p = 2; p * p <= n; p++) {
            if (Prime[p] == true) {
                prime.add(p);
                for (int i = p * p; i <= n; i += p) {
                    Prime[i] = false;
                }
            }
        }
    }
}


import java.util.*;
import java.io.*;
public class Solution{

    static class Pair<A, B> {

        A parent;
        B rank;

        Pair(A parent, B rank) {
            this.rank = rank;
            this.parent = parent;
        }
    }

    static class Node {
        int x;
        int y;
        Node(int k,int l)
        {
            x=k;y=l;
        }
    }
    static int m=1000000007;
    public static void main(String[] args) throws IOException {
        FastReader s1 = new FastReader();
        StringBuilder sb = new StringBuilder();
        int t=s1.I();
        while(t--!=0)
        {
            int n=s1.I();
            String patt = s1.next();
            String mat = "abacaba";
            int ans = ans(patt,mat);
//            System.out.println(ans+" ans");
            if(ans==2)
            {
                sb.append("NO\n");
                continue;
            }
            if(ans==1)
            {
                sb.append("YES\n");
                for(int i=0;i<patt.length();i++)
                {
                    if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                }
            }
            else
            {
                ans=match(patt,mat);
//                System.out.println("kkkkllll "+ans);
                if(ans==-1)
                {
                    sb.append("NO");
                }
                else
                {
                    sb.append("YES\n");
                    for(int i=0;i<ans;i++)
                    {
                        if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                    }
                    sb.append(mat);
                    for(int i=(ans+mat.length());i<patt.length();i++)
                    {
                        if(patt.charAt(i)=='?')
                    {
                        sb.append("z");
                    }
                    else
                        sb.append(patt.charAt(i));
                    }
                }
            }
            sb.append("\n");
        }
        System.out.println(sb);
    }
    static int match(String patt,String mat)
    {
        int j=0;
        for(int i=0;i<patt.length();i++)
        {
            j=0;
            if(patt.charAt(i)==mat.charAt(j) || patt.charAt(i)=='?')
            {
                int k=i;
//                System.out.println(k+" kkk "+j);
                while(k<patt.length() && j<mat.length() && (patt.charAt(k)==mat.charAt(j) || patt.charAt(j)=='?'))
                {
                    k++;
                    j++;
                }
//                System.out.println(k+" llll "+j);
                if(j==mat.length())
                {
                    return i;
                }
            }
        }
        return -1;
    }
    static int ans(String patt,String match)
    {
        int ind=patt.indexOf(match,0);
        int count=0;
        if(ind==-1)
            return count;
        count++;
        ind=patt.indexOf(match,ind+1);
        if(ind==-1)
        {
            return count;
        }
        return 2;
    }
    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int I() {
            return Integer.parseInt(next());
        }

        long L() {
            return Long.parseLong(next());
        }

        double D() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        }
        return gcd(b, a % b);
    }

    static float power(float x, int y) {
        float temp;
        if (y == 0) {
            return 1;
        }
        temp = power(x, y / 2);

        if (y % 2 == 0) {
            return temp * temp;
        } else {
            if (y > 0) {
                return x * temp * temp;
            } else {
                return (temp * temp) / x;
            }
        }
    }
    static long pow(long x, long y) {
        long res = 1;
        x = x % m;
        if (x < 0) {
            x += m;
        }
        while (y > 0) {
            if ((y & 1) == 1) {
                res = (res * x) % m;
                if (res < 0) {
                    res += m;
                }
            }
            y = y >> 1;
            x = (x * x) % m;
            if (x < 0) {
                x = x + m;
            }
        }
        res = res % m;
        if (res < 0) {
            res += m;
        }
        return res;
    }

    static void sieveOfEratosthenes(int n) {
        ArrayList<Integer> prime = new ArrayList<Integer>();
        boolean Prime[] = new boolean[n + 1];
        for (int i = 2; i < n; i++) {
            Prime[i] = true;
        }

        for (int p = 2; p * p <= n; p++) {
            if (Prime[p] == true) {
                prime.add(p);
                for (int i = p * p; i <= n; i += p) {
                    Prime[i] = false;
                }
            }
        }
    }
}


import java.util.*;
import java.io.*;
public class Solution{

    static class Pair<A, B> {

        A parent;
        B rank;

        Pair(A parent, B rank) {
            this.rank = rank;
            this.parent = parent;
        }
    }

    static class Node {
        int x;
        int y;
        Node(int k,int l)
        {
            x=k;y=l;
        }
    }
    static int m=1000000007;
    public static void main(String[] args) throws IOException {
        FastReader s1 = new FastReader();
        StringBuilder sb = new StringBuilder();
        int t=s1.I();
        while(t--!=0)
        {
            int n=s1.I();
            String patt = s1.next();
            String mat = "abacaba";
            String ans = match(patt,mat);
            if(ans.length()==0)
            {
                sb.append("NO\n");
            }
            else
            {
                sb.append("YES\n");
                sb.append(ans+"\n");
            }
        }
        System.out.println(sb);
    }
    static String match(String patt,String mat)
    {
        int j=0;
        for(int i=0;i<patt.length();i++)
        {
            j=0;
            if(patt.charAt(i)==mat.charAt(j) || patt.charAt(i)=='?')
            {
                int k=i;
                while(k<patt.length() && j<mat.length() && (patt.charAt(k)==mat.charAt(j) || patt.charAt(k)=='?'))
                {
                    k++;
                    j++;
                }
                if(j==mat.length())
                {
                    StringBuilder sb = new StringBuilder();
                    for(int ll=0;ll<i;ll++)
                    {
                        if(patt.charAt(ll)=='?')
                        {
                            sb.append("z");
                        }
                        else
                            sb.append(patt.charAt(ll));
                    }
//                    System.out.println(" forst "+sb+" "+i);
                    sb.append(mat);
//                    System.out.println(" forst2 "+sb+" "+i);
                    for(int ll=(i+mat.length());ll<patt.length();ll++)
                    {
                        if(patt.charAt(ll)=='?')
                        {
                            sb.append("z");
                        }
                        else
                        sb.append(patt.charAt(ll));
                    }
//                    System.out.println("third "+sb);
                    String gg=sb.toString();
                    int ans=ans(gg,mat);
                    if(ans==1)
                    {
                        return gg;
                    }
                }
            }
        }
        return "";
    }
    static int ans(String patt,String match)
    {
        int ind=patt.indexOf(match,0);
        int count=0;
        if(ind==-1)
            return count;
        count++;
        ind=patt.indexOf(match,ind+1);
        if(ind==-1)
        {
            return count;
        }
        return 2;
    }
    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int I() {
            return Integer.parseInt(next());
        }

        long L() {
            return Long.parseLong(next());
        }

        double D() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        }
        return gcd(b, a % b);
    }

    static float power(float x, int y) {
        float temp;
        if (y == 0) {
            return 1;
        }
        temp = power(x, y / 2);

        if (y % 2 == 0) {
            return temp * temp;
        } else {
            if (y > 0) {
                return x * temp * temp;
            } else {
                return (temp * temp) / x;
            }
        }
    }
    static long pow(long x, long y) {
        long res = 1;
        x = x % m;
        if (x < 0) {
            x += m;
        }
        while (y > 0) {
            if ((y & 1) == 1) {
                res = (res * x) % m;
                if (res < 0) {
                    res += m;
                }
            }
            y = y >> 1;
            x = (x * x) % m;
            if (x < 0) {
                x = x + m;
            }
        }
        res = res % m;
        if (res < 0) {
            res += m;
        }
        return res;
    }

    static void sieveOfEratosthenes(int n) {
        ArrayList<Integer> prime = new ArrayList<Integer>();
        boolean Prime[] = new boolean[n + 1];
        for (int i = 2; i < n; i++) {
            Prime[i] = true;
        }

        for (int p = 2; p * p <= n; p++) {
            if (Prime[p] == true) {
                prime.add(p);
                for (int i = p * p; i <= n; i += p) {
                    Prime[i] = false;
                }
            }
        }
    }
}


//package r657;

import java.util.Scanner;

public class first {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		String target = "abacaba";
		while(t-->0)
		{
			int len = sc.nextInt();
		    char c[] = sc.next().toCharArray();
		    if(c.length<7)
		    {
		    	System.out.println("No");
		    	continue;
		    }
		    int i =0;
		    int occur=0;
		    int add = 0;
		    while(i<c.length)
		    {
		    	int j = i;
		    	int k = 0;
		    	boolean fill = false;
		    	for(;k<7 && j<c.length;k++)
		    	{
		    		if(c[j]!=target.charAt(k))
		    		{
		    			if(c[j]!='?')
		    				break;
		    			else
		    			{
		    				fill= true;
		    			}
		    		}
		    		j++;
		    	}
		    	if(k==7)
		    	{
		    		if(fill)
		    			add++;
		    		else
		    			occur++;
		    	}
		    	i++;
		    }
		    //System.out.println(occur);
		    if(occur == 1)
		    {
		    	System.out.println("Yes");
		    	for(i=0;i<c.length;i++)
		    	{
		    		if(c[i]=='?')
		    			System.out.print('d');
		    		else
		    			System.out.print(c[i]);
		    	}
		    	System.out.println();
		    }
		    else if(occur>1)
		    {
		    	System.out.println("No");
		    }
		    else if(occur==0 && add>0)
		    {
		    	if(add==1)
		    	{
		    		System.out.println("Yes");
		    		i =0;
			    	while(i<c.length)
			    	{
			    		int k =0;
			    		int j = i;
			    		for(;k<7 && j<c.length;k++)
			    		{
			    			if(c[j]!=target.charAt(k) && c[j]=='?')
			    			{
			    				c[j] = target.charAt(k);
			    			}
			    			j++;
			    		}
			    		System.out.print(c[i]);
			    		i++;

			    	}
			    	System.out.println();
		    	}
		    	else
		    	{
		    		i =0;
		    		int check =0;
			    	while(i<c.length)
			    	{
			    		int k =0;
			    		int j = i;
			    		for(;k<7 && j<c.length;k++)
			    		{
			    			if(c[j]!=target.charAt(k) )
			    			{
			    				if(c[j]=='?' && check==0)
			    					c[j] = target.charAt(k);
			    				else
			    					break;
			    			}
			    			j++;
			    		}
			    		if(k==7)
			    		{
			    			check++;
			    		}

			    		i++;

			    	}
			    	if(check>1)
			    	{
			    		System.out.println("No");
			    	}
			    	else
			    	{
			    		System.out.println("Yes");
				    	for(i=0;i<c.length;i++)
				    	{
				    		if(c[i]=='?')
				    			System.out.print('d');
				    		else
				    			System.out.print(c[i]);
				    	}
				    	System.out.println();
			    	}
		    	}
		    }
		    else
		    {
		    	System.out.println("No");
		    }
		}

	}

}


//package r657;

import java.util.Scanner;

public class first {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		String target = "abacaba";
		while(t-->0)
		{
			int len = sc.nextInt();
		    char c[] = sc.next().toCharArray();
		    if(c.length<7)
		    {
		    	System.out.println("No");
		    	continue;
		    }
		    int i =0;
		    int occur=0;
		    int add = 0;
		    while(i<c.length)
		    {
		    	int j = i;
		    	int k = 0;
		    	boolean fill = false;
		    	for(;k<7 && j<c.length;k++)
		    	{
		    		if(c[j]!=target.charAt(k))
		    		{
		    			if(c[j]!='?')
		    				break;
		    			else
		    			{
		    				fill= true;
		    			}
		    		}
		    		j++;
		    	}
		    	if(k==7)
		    	{
		    		if(fill)
		    			add++;
		    		else
		    			occur++;
		    	}
		    	i++;
		    }
		    //System.out.println(occur);
		    if(occur == 1)
		    {
		    	System.out.println("Yes");
		    	for(i=0;i<c.length;i++)
		    	{
		    		if(c[i]=='?')
		    			System.out.print('d');
		    		else
		    			System.out.print(c[i]);
		    	}
		    	System.out.println();
		    }
		    else if(occur>1)
		    {
		    	System.out.println("No");
		    }
		    else if(occur==0 && add>0)
		    {
		    	if(add==1)
		    	{
		    		System.out.println("Yes");
		    		i =0;
			    	while(i<c.length)
			    	{
			    		int k =0;
			    		int j = i;
			    		for(;k<7 && j<c.length;k++)
			    		{
			    			if(c[j]!=target.charAt(k) && c[j]=='?')
			    			{
			    				c[j] = target.charAt(k);
			    			}
			    			j++;
			    		}
			    		System.out.print(c[i]);
			    		i++;

			    	}
			    	System.out.println();
		    	}
		    	else
		    	{
		    		i =0;
		    		int check =0;
			    	while(i<c.length)
			    	{
			    		int k =0;
			    		int j = i;
			    		for(;k<7;k++)
			    		{
			    			if(c[j]!=target.charAt(k) )
			    			{
			    				if(c[j]=='?' && check==0)
			    					c[j] = target.charAt(k);
			    				else
			    					break;
			    			}
			    			j++;
			    		}
			    		if(k==7)
			    		{
			    			check++;
			    		}

			    		i++;

			    	}
			    	if(check>1)
			    	{
			    		System.out.println("No");
			    	}
			    	else
			    	{
			    		System.out.println("Yes");
				    	for(i=0;i<c.length;i++)
				    	{
				    		if(c[i]=='?')
				    			System.out.print('d');
				    		else
				    			System.out.print(c[i]);
				    	}
				    	System.out.println();
			    	}
		    	}
		    }
		    else
		    {
		    	System.out.println("No");
		    }
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public final class CodeForces {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        while(t-->0) {
            int n = Integer.parseInt(br.readLine());
            String s = br.readLine();
            char[] c = s.toCharArray();
            char[] sub = {'a', 'b', 'a', 'c', 'a', 'b', 'a'};
            if(n < 7) {
                System.out.println("No");
            } else if(n == 7) {
                boolean possible = true;
                for(int i=0; i<7; i++) {
                    if(c[i] != sub[i] && c[i] != '?') {
                        possible = false;
                        break;
                    }
                    c[i] = sub[i];
                }
                if(possible) {
                    System.out.println("Yes");
                    System.out.println(new String(sub));
                } else {
                    System.out.println("No");
                }
            } else {
                int occurance = 0;
                for(int i=0; i<n-6; i++) {
                    for(int j=i; j<i+7; j++) {
                        if(c[j] != sub[j-i])
                            break;
                        if(j == i+6)
                            occurance++;
                    }
                }
                if(occurance > 1) {
                    System.out.println("No");
                } else if(occurance == 1) {
                    for(int i=0; i<n; i++) {
                        if(c[i] == '?')
                            c[i] = 'z';
                    }
                    System.out.println("Yes");
                    System.out.println(new String(c));
                } else {
                    ArrayList<Integer> pos = new ArrayList<>();
                    for(int i=0; i<n; i++) {
                        if(c[i] == '?')
                            pos.add(i);
                    }
                    boolean possible = false;
                    char[] temp = new char[n];
                    int count;
                    for(int i=0; i<pos.size(); i++) {
                        for(int j=0; j<n; j++)
                            temp[j] = c[j];
                        count = 0;
                        //System.out.println(pos.get(i));
                        for(int j=0; j<n-6; j++) {
                            for(int k=j; k<j+7; k++)  {
                                if(temp[k] == '?') {
                                    if(k >= pos.get(i))
                                        temp[k] = sub[k-j];
                                    else
                                        temp[k] = 'z';
                                }
                                /*if(i == 1)
                                    System.out.println(temp[k] + " " + sub[k-j]);*/
                                if(temp[k] != sub[k-j])
                                    break;
                                if(k == j+6)
                                    count++;
                            }
                            if(count > 0)
                                break;
                        }
                        int occ = 0;
                        for(int j=0; j<n-6; j++) {
                            for(int k=j; k<j+7; k++) {
                                if(temp[k] != sub[k-j])
                                    break;
                                if(k == j + 6)
                                    occ++;
                            }
                        }
                        if(occ == 1) {
                            for(int j=0; j<n; j++) {
                                c[j] = temp[j];
                                if(c[j] == '?')
                                    c[j] = 'z';
                            }
                            possible = true;
                            break;
                        }
                    }
                    if(!possible)
                        System.out.println("No");
                    else {
                        System.out.println("Yes");
                        System.out.println(new String(c));
                    }
                }
            }
        }
        br.close();
    }
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.*;

public class Solution {

    public static int count(String s, String toCompare){
        char[] arr = s.toCharArray();

        int cnt = 0;

        for (int i = 0; i <= arr.length - toCompare.length(); i++) {

            if (s.startsWith(toCompare, i)) {

                cnt += 1;

            }

        }
        return cnt;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t;
        t = in.nextInt();

        while ((t--) > 0) {
            int n;

            n = in.nextInt();
            in.nextLine();
            String s = in.nextLine();

            String toCompare = "abacaba";

            int cnt = count(s, toCompare);

            if (cnt > 1) {

                System.out.println("No");

            } else if (cnt == 1) {

                char[] arr = s.toCharArray();
                for (int i = 0; i < arr.length; i++) {

                    if (arr[i] == '?') {
                        arr[i] = 'd';
                    }
                }

                System.out.println("Yes");
                System.out.println(String.valueOf(arr));

            } else {

                boolean rep = false;
                char[] arr = s.toCharArray();

                for (int i = 0; i <= arr.length - 7; i++) {

                    boolean found = true;
                    char[] arr2 = new char[7];

                    for (int k = 0; k < 7; k++) {

                        arr2[k] = arr[i + k];

                    }

                    for (int k = 0; k < 7; k++) {

                        if (arr2[k] == '?') {
                            arr2[k] = toCompare.charAt(k);
                        } else if (arr2[k] != toCompare.charAt(k)) {
                            found = false;
                            break;
                        }

                    }

                    if (found) {

                        char[] checkArr = Arrays.copyOf(arr, arr.length);

                        for (int k = 0; k < 7; k++) {

                            checkArr[i + k] = arr2[k];

                        }

                        int nowCnt = count(String.valueOf(checkArr), toCompare);

                        if (nowCnt==1) {

                            for (int k = 0; k < 7; k++) {

                                arr[i + k] = arr2[k];

                            }

                            for (int k = 0; k < arr.length; k++) {

                                if (arr[k] == '?') {
                                    arr[k] = 'd';
                                }

                            }

                            System.out.println("Yes");
                            System.out.println(String.valueOf(arr));

                            rep = true;
                            break;
                        }

                    }

                }

                if (!rep) {
                    System.out.println("No");

                }

            }

        }

    }
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t;
        t = in.nextInt();

        while ((t--) > 0) {
            int n;

            n = in.nextInt();
            in.nextLine();
            String s = in.nextLine();

            char[] arr = s.toCharArray();

            // int i = 0;

            String toCompare = "abacaba";

            int cnt = 0;

            for (int i = 0; i <= arr.length - 7; i++) {

                if (s.startsWith(toCompare, i)) {

                    cnt += 1;

                }

            }

            if (cnt > 1) {

                System.out.println("No");
                continue;
            } else if (cnt == 1) {

                for (int i = 0; i < arr.length; i++) {

                    if (arr[i] == '?') {
                        arr[i] = 'd';
                    }
                }

                System.out.println("Yes");
                System.out.println(String.valueOf(arr));

            } else {

                boolean rep = false;
                int j = 0;
                for (int i = 0; i <= arr.length - 7; i++) {

                    boolean found = true;
                    char[] arr2 = new char[7];

                    for (int k = 0; k < 7; k++) {

                        arr2[k] = arr[i + k];

                    }

                    for (int k = 0; k < 7; k++) {

                        if (arr2[k] == '?') {
                            arr2[k] = toCompare.charAt(k);
                        } else if (arr2[k] != toCompare.charAt(k)) {
                            found = false;
                            break;
                        }

                    }

                    if (found) {
                        j = i;
                        rep = true;

                        cnt++;

                        char[] checkArr = Arrays.copyOf(arr, arr.length);

                        for (int k = 0; k < 7; k++) {

                            checkArr[i + k] = arr2[k];

                        }

                        boolean extraF = false;
                        for (int k = i + 1; k <= checkArr.length; k++) {
                            if (toCompare.equals(String.valueOf(Arrays.copyOfRange(checkArr, k, k+7)))) {
                                extraF = true;
                                break;
                            }
                        }

                        if (!extraF) {

                            for (int k = 0; k < 7; k++) {

                                arr[i + k] = arr2[k];

                            }

                            for (int k = i + 1; k < arr.length; k++) {

                                if (arr[i] == '?') {
                                    arr[i] = 'd';
                                }

                            }

                            System.out.println("Yes");
                            System.out.println(String.valueOf(arr));

                            rep = true;
                            break;
                        }

                    }

                }

                if (!rep) {
                    System.out.println("No");

                }

            }

        }

    }
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t;
        t = in.nextInt();

        while((t--) > 0 ){
            int n,m;
            String s;

            n = in.nextInt();
            s = in.nextLine();
            in.next();
            char[] arr = s.toCharArray();

            // int i = 0;

            String toCompare = "abacaba";

            int cnt = 0;

            for(int i = 0 ; i < arr.length - 7; i++){

                if(s.startsWith(toCompare, i)){

                    cnt += 1;

                }

            }

            if(cnt > 1){

                    System.out.println("No");
                    continue;
            } else if(cnt == 1){

                for(int i = 0; i < arr.length; i++){

                    if(arr[i]=='?'){
                        arr[i] = 'd';
                    }
                }

                System.out.println("Yes");
                System.out.println(String.valueOf(arr));

            } else {

                boolean rep = false;
                int j = 0;
                for(int i = 0 ; i < arr.length -7 ; i++){

                    boolean found = true;
                    char[] arr2 = new char[7];

                    for(k = 0; k < 7; k++){

                       arr2[k] = arr[i+k];

                    }

                    for(k = 0; k < 7; k++){

                       if(arr2[k]=='?'){
                        arr2[k] = toCompare.charAt(k);
                       } else if(arr2[k] != toCompare.charAt(k)){
                            found = false;
                            break;
                       }

                    }

                    if(found){
                        j = i;
                        rep = true;
                        cnt++;
                        break;
                        for(k = 0; k < 7; k++){

                            arr[i+k] = arr2[k];

                        }

                    }

                }

                if(rep==false){
                    System.out.println("No");

                } else {

                    for(int i = j+1; i < arr.length; i++){

                        if(arr[i]=='?'){
                                arr[i] = 'd';
                            }

                    }

                System.out.println("Yes");
                System.out.println(String.valueOf(arr));

                }

            }

        }

    }
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t;
        t = in.nextInt();

        while ((t--) > 0) {
            int n;

            n = in.nextInt();
            in.nextLine();
            String s = in.nextLine();

            char[] arr = s.toCharArray();

            // int i = 0;

            String toCompare = "abacaba";

            int cnt = 0;

            for (int i = 0; i <= arr.length - 7; i++) {

                if (s.startsWith(toCompare, i)) {

                    cnt += 1;

                }

            }

            if (cnt > 1) {

                System.out.println("No");
                continue;
            } else if (cnt == 1) {

                for (int i = 0; i < arr.length; i++) {

                    if (arr[i] == '?') {
                        arr[i] = 'd';
                    }
                }

                System.out.println("Yes");
                System.out.println(String.valueOf(arr));

            } else {

                boolean rep = false;
                int j = 0;
                for (int i = 0; i <= arr.length - 7; i++) {

                    boolean found = true;
                    char[] arr2 = new char[7];

                    for (int k = 0; k < 7; k++) {

                        arr2[k] = arr[i + k];

                    }

                    for (int k = 0; k < 7; k++) {

                        if (arr2[k] == '?') {
                            arr2[k] = toCompare.charAt(k);
                        } else if (arr2[k] != toCompare.charAt(k)) {
                            found = false;
                            break;
                        }

                    }

                    if (found) {
                        j = i;
                        rep = true;

                        cnt++;

                        char[] checkArr = Arrays.copyOf(arr, arr.length);

                        for (int k = 0; k < 7; k++) {

                            checkArr[i + k] = arr2[k];

                        }

                        boolean extraF = false;
                        for (int k = i + 1; k <= checkArr.length; k++) {
                            if (toCompare.equals(String.valueOf(Arrays.copyOfRange(checkArr, k, 7)))) {
                                extraF = true;
                                break;
                            }
                        }

                        if (!extraF) {

                            for (int k = 0; k < 7; k++) {

                                arr[i + k] = arr2[k];

                            }

                            for (int k = i + 1; k < arr.length; k++) {

                                if (arr[i] == '?') {
                                    arr[i] = 'd';
                                }

                            }

                            System.out.println("Yes");
                            System.out.println(String.valueOf(arr));

                            rep = true;
                            break;
                        }

                    }

                }

                if (!rep) {
                    System.out.println("No");

                }

            }

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ATailouloute
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        QuickScanner in = new QuickScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, QuickScanner in, PrintWriter out) {
            long[] m = in.nextLongArray(5);
            long[] w = in.nextLongArray(5);
            long hs = in.nextLong();
            long hu = in.nextLong();
            long total = 0;
            for (int i = 0; i < 5; i++) {
                long x = (i + 1) * 500;
                total += Math.max(x, 10 * ((x - x * m[i] / 250) - 50 * w[i]));
            }
            total += (hs * 1000);
            total -= (hu * 500);
            out.println(total / 10);
        }

    }

    static class QuickScanner {
        BufferedReader br;
        StringTokenizer st;
        InputStream is;

        public QuickScanner(InputStream stream) {
            is = stream;
            br = new BufferedReader(new InputStreamReader(stream), 32768);
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

        public long[] nextLongArray(int len) {
            long[] a = new long[len];
            for (int i = 0; i < len; i++) {
                a[i] = nextLong();
            }
            return a;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ATailouloute
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        QuickScanner in = new QuickScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, QuickScanner in, PrintWriter out) {
            int[] m = in.nextIntArray(5);
            int[] w = in.nextIntArray(5);
            int hs = in.nextInt();
            int hu = in.nextInt();
            long total = 0;
            for (int i = 0; i < 5; i++) {
                int x = (i + 1) * 500;
                total += Math.max((int) 0.3 * x, (x - x * m[i] / 250) - 50 * w[i]);
            }
            total += (hs * 100);
            total -= (hu * 50);
            out.println(total);
        }

    }

    static class QuickScanner {
        BufferedReader br;
        StringTokenizer st;
        InputStream is;

        public QuickScanner(InputStream stream) {
            is = stream;
            br = new BufferedReader(new InputStreamReader(stream), 32768);
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        int[] nextIntArray(int len) {
            int[] a = new int[len];
            for (int i = 0; i < len; i++) {
                a[i] = nextInt();
            }
            return a;
        }

    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] m = new int[5];
        int[] w = new int[5];
        int[] h = new int[2];
        int score = 0;
        int i;
        int a;
        int b;
        for (i = 0; i < 5; i++) {
            m[i] = scanner.nextInt();
        } for (i = 0; i < 5; i++) {
            w[i] = scanner.nextInt();
        } for (i = 0; i < 2; i++) {
            h[i] = scanner.nextInt();
        } for (i = 0; i < 5; i++) {
            b = i * 500 + 500;
            a = b * (250 - m[i]) / 250 - 50 * w[i];
            if (a < b / 10 * 3) {
                score += b / 10 * 3;
            } else {
                score += a;
            }
        } score += 100 * h[0] - 50 * h[1];
        System.out.println(score);
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] m = new int[5];
        int[] w = new int[5];
        int[] h = new int[2];
        int score = 0;
        int i;
        for (i = 0; i < 5; i++) {
            m[i] = scanner.nextInt();
        } for (i = 0; i < 5; i++) {
            w[i] = scanner.nextInt();
        } for (i = 0; i < 2; i++) {
            h[i] = scanner.nextInt();
        } for (i = 0; i < 5; i++) {
            score += (i * 500 + 500) * (250 - m[i]) / 250 - 50 * w[i];
        } score += 100 * h[0] - 50 * h[1];
        System.out.println(score);
    }
}


import java.util.*;
import java.math.*;
import java.io.*;
public class Ltower
{
    public static void main(String args []) throws IOException
    {
        new Ltower().run();
    }
    public PrintWriter pw;
    public void run()   throws IOException
    {
        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        pw=new PrintWriter(System.out, true);

        String s[]=in.readLine().split(" ");
        int m[] = new int[5];
        int i = 0;
        while(i<5){
            m[i] = Integer.parseInt(s[i]);
            i++;
        }

        s=in.readLine().split(" ");
        int w[] = new int[5];
        i = 0;
        while(i<5){
            w[i] = Integer.parseInt(s[i]);
            i++;
        }

        s=in.readLine().split(" ");
        int h[] = new int[2];
        i = 0;
        while(i<2){
            h[i] = Integer.parseInt(s[i]);
            i++;
        }

        long sum = Math.max(150, (500-2*m[0])-50*w[0])+Math.max(300, (1000-4*m[1])-50*w[1])+Math.max(450, (1500-6*m[2])-50*w[2])+Math.max(600, (2000-8*m[3])-50*w[3])+
                Math.max(750, (2500-10*m[4])-50*w[4]) + (100*h[0]-(50*h[1]));
        pw.println(sum);
    }
    public void mk(int arr[][], int ind,int m)
    {
        for(int i=0; i<m; i++)
        {
                arr[i][ind]=0;
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.PriorityQueue;

public class Ltower
{
    private long[] Heap;
    private int size;
    private int maxsize;

    private static final int FRONT = 1;

    public Ltower(int maxsize)
    {
        this.maxsize = maxsize;
        this.size = 0;
        Heap = new long[this.maxsize + 1];
        Heap[0] = Integer.MIN_VALUE;
    }

    private int parent(int pos)
    {
        return pos / 2;
    }

    private int leftChild(int pos)
    {
        return (2 * pos);
    }

    private int rightChild(int pos)
    {
        return (2 * pos) + 1;
    }

    private boolean isLeaf(int pos)
    {
        if (pos >=  (size / 2)  &&  pos <= size)
        {
            return true;
        }
        return false;
    }

    private void swap(int fpos,int spos)
    {
        long tmp;
        tmp = Heap[fpos];
        Heap[fpos] = Heap[spos];
        Heap[spos] = tmp;
    }

    private void maxHeapify(int pos)
    {
        if (!isLeaf(pos))
        {
            if ( Heap[pos] > Heap[leftChild(pos)]  || Heap[pos] > Heap[rightChild(pos)])
            {
                if (Heap[leftChild(pos)] < Heap[rightChild(pos)])
                {
                    swap(pos, leftChild(pos));
                    maxHeapify(leftChild(pos));
                }else
                {
                    swap(pos, rightChild(pos));
                    maxHeapify(rightChild(pos));
                }
            }
        }
    }

    public void insert(long element)
    {
        Heap[++size] = element;
        int current = size;

        while(Heap[current] < Heap[parent(current)])
        {
            swap(current,parent(current));
            current = parent(current);
        }
    }

    public void print()
    {
        for (int i = 1; i <= size / 2; i++ )
        {
            System.out.print(" PARENT : " + Heap[i] + " LEFT CHILD : " + Heap[2*i]
                  + " RIGHT CHILD :" + Heap[2 * i  + 1]);
            System.out.println();
        }
    }

    public void maxHeap()
    {
        for (int pos = (size / 2); pos >= 1; pos--)
        {
            maxHeapify(pos);
        }
    }

    public long remove()
    {
        long popped = Heap[FRONT];
        Heap[FRONT] = Heap[size--];
        maxHeapify(FRONT);
        return popped;
    }

    public static void main(String...arg) throws Exception
    {
        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out, true);

        String s[]=in.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int k = Integer.parseInt(s[1]);

        PriorityQueue<Long> pq = new PriorityQueue<>(10, new Comparator<Long>() {

            @Override
            public int compare(Long o1, Long o2) {
                // TODO Auto-generated method stub
                return o1.compareTo(o2);
            }
        });

//       System.out.println("The Max Heap is ");
//          Ltower maxHeap = new Ltower(n);
        s = in.readLine().split(" ");
                if(k>=n)
                pw.println(s[n-1]);
                else{
        long arr[]= new long[n];
        int i=0;
        while(i<n){
            arr[i] = Long.parseLong(s[i]);
            pq.offer(arr[i]);
            i++;
        }

        //long ans = arr[0];
        i=0;int noofelement = n;
        while(i<(n-k)){
            i++;
            long temp1 = pq.poll();
            long temp2 = pq.poll();
            pq.offer(temp1+temp2);
                    noofelement--;
        }
        i=1;
        while(i<noofelement){
            i++;
            pq.poll();
        }
        pw.println(pq.poll());

               }

    }
}


import java.util.*;
import java.math.*;
import java.io.*;
public class Ltower
{
	public static void main(String args [])	throws IOException
	{
		new Ltower().run();
	}
	public PrintWriter pw;
	public void run()	throws IOException
	{
		BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
		pw=new PrintWriter(System.out, true);

		String s[]=in.readLine().split(" ");
		int m[] = new int[5];
		int i = 0;
		while(i<5){
			m[i] = Integer.parseInt(s[i]);
			i++;
		}

		s=in.readLine().split(" ");
		int w[] = new int[5];
		i = 0;
		while(i<5){
			w[i] = Integer.parseInt(s[i]);
			i++;
		}

		s=in.readLine().split(" ");
		int h[] = new int[2];
		i = 0;
		while(i<2){
			h[i] = Integer.parseInt(s[i]);
			i++;
		}

		long sum = Math.max(150, (500-2*m[0])-50*w[0])+Math.max(300, (1000-4*m[1])-50*w[1])+Math.max(450, (1500-6*m[2])-50*w[2])+Math.max(600, (2000-8*m[3])-50*w[3])+
				Math.max(750, (2500-10*m[4])-50*w[4]) + (100*h[0]-(50*h[1]));
		pw.println(sum);
	}
	public void mk(int arr[][], int ind,int m)
	{
		for(int i=0; i<m; i++)
		{
				arr[i][ind]=0;
		}

	}
}


import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Created by Timur on 22.11.2016.
 */
public class _604A {
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int m[] = new int[5];
        int w[] = new int[5];
        int points[] = {500, 1000, 1500, 2000, 2500};
        int luck, noluck;
        for(int i = 0; i < 5; i++)
            m[i] = in.nextInt();
        for(int i = 0; i < 5; i++)
            w[i] = in.nextInt();
        luck = in.nextInt();
        noluck = in.nextInt();
        double result = 0;
        for(int i = 0; i < 5;i++)
            result += Math.max(0.3 * points[i], (1 - m[i]/250.0)  * points[i] - 50 * w[i]);
        result += luck * 100 - noluck * 50;
        out.print((int)result);
        out.close();
    }
}


import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Created by Timur on 22.11.2016.
 */
public class _604A {
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int m[] = new int[5];
        int w[] = new int[5];
        int points[] = {500, 1000, 1500, 2000, 2500};
        int luck, noluck;
        for(int i = 0; i < 5; i++)
            m[i] = in.nextInt();
        for(int i = 0; i < 5; i++)
            w[i] = in.nextInt();
        luck = in.nextInt();
        noluck = in.nextInt();
        double result = 0;
        for(int i = 0; i < 5;i++)
            result += Math.max( 3 * points[i] / 10, (250 - m[i]) * points[i] / 250.0   - 50 * w[i]);
        result += luck * 100 - noluck * 50;
        out.print((int)result);
        out.close();
    }
}


import java.io.*;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;

	 public class Palindrome {

		static double eps=(double)1e-6;
		static long mod=(int)1e9+7;
		public static void main(String args[]){
			InputReader in = new InputReader(System.in);
			OutputStream outputStream = System.out;
			PrintWriter out = new PrintWriter(outputStream);
			//----------My Code----------
			int m[]=new int[5];
			int w[]=new int[5];
			for(int i=0;i<5;i++)
				m[i]=in.nextInt();
			for(int i=0;i<5;i++)
				w[i]=in.nextInt();
			int hs=in.nextInt();
			int hw=in.nextInt();
			int total=0;
			int base=500;
			for(int i=0;i<5;i++){
				float h=(1-(float)m[i]/250)*(base*(i+1))-50*w[i];
				float x=(float)0.3*base*(i+1);
				total+=Math.max(h, x);
			}
			total+=(hs)*100-hw*50;
			System.out.println(total);

			//---------------The End------------------
			out.close();
		}

			static class TrieNode{
				boolean isLeaf;
				int b;
				TrieNode[] a=new TrieNode[256];
			}

			static void insert(String key,TrieNode root){
				TrieNode temp=root;
				for(int i=0;i<key.length();i++){
				//	System.out.println(i);

					if(temp.a[key.charAt(i)]==null){
						temp.a[key.charAt(i)]=new TrieNode();
					}
					temp.a[key.charAt(i)].b+=1;
					temp=temp.a[key.charAt(i)];

				}
				temp.isLeaf=true;
			}
			static TrieNode search(String key,TrieNode root){
				TrieNode temp=root;
				for(int i=0;i<key.length();i++){

					if(temp.a[key.charAt(i)]==null)
						return null;
					temp=temp.a[key.charAt(i)];

				}
				return (temp);
			}
			static String max(String key,TrieNode root){
				TrieNode temp=root;
				String res="";
				for(int i=0;i<key.length();i++){

					if(temp.a[(key.charAt(i)-'0')^1]!=null){
					//	System.out.println("Hetr");
					temp=temp.a[(key.charAt(i)-'0')^1];
					res+="1";
					}
					else if(temp.a[(key.charAt(i)-'0')]!=null){
						//System.out.println("Hetr");
						temp=temp.a[(key.charAt(i)-'0')];
						res+="0";
					}
				}
			//	System.out.println(res+"jj");
				return res;
			}
			static void remove(String key,TrieNode root){
				TrieNode temp=root;
				for(int i=0;i<key.length();i++){
					if(temp==null)
						return;
				  if(temp.a[(key.charAt(i)-'0')]!=null&&temp.a[key.charAt(i)-'0'].b>1){

						temp.a[(key.charAt(i)-'0')].b--;

					temp=temp.a[(key.charAt(i)-'0')];
				}
				else
				{
					temp.a[key.charAt(i)-'0']=null;
					return;
				}
				}
				if(temp!=null)
					temp.isLeaf=false;
			}

			public static void printSorted(TrieNode node, String s) {
		        for (int ch = 0; ch < node.a.length; ch++) {
		            TrieNode child = node.a[ch];
		            if (child != null){
		                printSorted(child, s + (char)(ch));
		            }
		        }
		        if (node.isLeaf) {
		            System.out.println(s);
		        }
		    }
		private static void permutation(String prefix, String str,HashSet<String> hs) {
		    int n = str.length();
		    if (n == 0) hs.add(prefix);
		    else {
		        for (int i = 0; i < n; i++)
		            permutation(prefix + str.charAt(i), str.substring(0, i) + str.substring(i+1, n),hs);
		    }
		}
		static int[][] floydWarshall(int graph[][],int V)
	    {
	        int dist[][] = new int[V][V];
	        int i, j, k;

	        /* Initialize the solution matrix same as input graph matrix.
	           Or we can say the initial values of shortest distances
	           are based on shortest paths considering no intermediate
	           vertex. */
	        for (i = 0; i < V; i++)
	            for (j = 0; j < V; j++)
	                dist[i][j] = graph[i][j];

	        /* Add all vertices one by one to the set of intermediate
	           vertices.
	          ---> Before start of a iteration, we have shortest
	               distances between all pairs of vertices such that
	               the shortest distances consider only the vertices in
	               set {0, 1, 2, .. k-1} as intermediate vertices.
	          ----> After the end of a iteration, vertex no. k is added
	                to the set of intermediate vertices and the set
	                becomes {0, 1, 2, .. k} */
	        for (k = 0; k < V; k++)
	        {
	            // Pick all vertices as source one by one
	            for (i = 0; i < V; i++)
	            {
	                // Pick all vertices as destination for the
	                // above picked source
	                for (j = 0; j < V; j++)
	                {
	                    // If vertex k is on the shortest path from
	                    // i to j, then update the value of dist[i][j]
	                    if (dist[i][k] + dist[k][j] < dist[i][j])
	                        dist[i][j] = dist[i][k] + dist[k][j];
	                }
	            }
	        }
	return dist;
	    }
		static int recursiveBinarySearch(int[] sortedArray, int start, int end, int key) {

			if (start <= end) {
				int mid = start + (end - start) / 2;
				if (key < sortedArray[mid]) {
					return recursiveBinarySearch(sortedArray, start, mid-1, key);

				} else if (key > sortedArray[mid]) {
					return recursiveBinarySearch(sortedArray, mid+1, end , key);

				} else {
					return mid;
				}
			}
			return -(start + 1);
		}

		static long modulo(long a,long b,long c) {
			long x=1;
			long y=a;
			while(b > 0){
				if(b%2 == 1){
					x=(x*y)%c;
				}

				y = (y*y)%c; // squaring the base
				b /= 2;
			}
			return  x%c;
		}

		static long gcd(long x, long y)

		{
			long r=0, a, b;
			a = (x > y) ? x : y; // a is greater number
			b = (x < y) ? x : y; // b is smaller number
			r = b;
			while(a % b != 0)
			{
				r = a % b;
				a = b;
				b = r;
			}
			return r;
		}
		static class pair implements Comparable<pair> {
			int x;
			int y;
			//int i;
			pair(int  xx,int yy){

				x=xx;
				y=yy;
				//i=ii;
			}
			@Override
			public int compareTo(pair arg0) {
				return Long.compare(this.y, arg0.y);
			}

		}
		static class InputReader {
			public BufferedReader reader;
			public StringTokenizer tokenizer;

			public InputReader(InputStream inputstream) {
				reader = new BufferedReader(new InputStreamReader(inputstream));
				tokenizer = null;
			}

			public String nextLine(){
				String fullLine=null;
				while (tokenizer == null || !tokenizer.hasMoreTokens()) {
					try {
						fullLine=reader.readLine();
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
					return fullLine;
				}
				return fullLine;
			}
			public String next() {
				while (tokenizer == null || !tokenizer.hasMoreTokens()) {
					try {
						tokenizer = new StringTokenizer(reader.readLine());
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
				}
				return tokenizer.nextToken();
			}
			public long nextLong() {
				return Long.parseLong(next());
			}
			public int nextInt() {
				return Integer.parseInt(next());
			}
		}
	}