import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.util.Scanner;
import java.io.PrintStream;
import java.lang.String;

public class Regex { 
    final String r;

    public Regex(Scanner in) {
	r = in.next();
	
	// This programme does not handle e and E properly (but nobody
	// handed in a solution that used e or E).
    }

    public static void main(String[] args){
	Scanner in = new Scanner(System.in);
	PrintStream out = System.out;
	
	String allZeroes = "000000000000000000000000";
	String allOnes = "11111111111111111111111";
	String r = in.next();
	boolean evenZeroes = true;

	Pattern p = Pattern.compile(r);
	int score = 0;

	String testString = "";
	while (testString.length() < 16) {
	    boolean expectedOutput = (testString.length() % 2 == 1) && evenZeroes;
	    Matcher m = p.matcher(testString);
	    out.print(testString + "  ");
	    if (m.matches() == expectedOutput) {
		score++;
		out.println("correct");
	    } else
		out.println("incorrect");

	    // increment test String
	    int pos = testString.lastIndexOf('0');
	    if (pos == -1) {
		testString = allZeroes.substring(0, 1 + testString.length());
		evenZeroes = (testString.length() % 2 == 0);
	    } else {
		testString = testString.substring(0, pos) + "1" + 
		    allZeroes.substring(1,testString.length()-pos); 
		evenZeroes = evenZeroes ^ ((testString.length() - pos) % 2 == 1);
	    }
	}
	out.println("Your regular expression worked for " + score + " of the 65535 test strings.");
	int grade;
        if (score <= 32768) grade = 0;
	else grade = 100 * (score - 32768) / 32767;
	if (score != 65535 && grade > 90) grade = 90;
	out.println("Grade on bonus question is " + grade + "%.");
    }	

}
	

