import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.io.*;
public class Solver {
	
	enum States{W,Z,O,I};
	
	public static void main(String[] args) throws IOException {
		
		Path filePath = Paths.get("input1.txt");
		Scanner reader = new Scanner(filePath);
		String message = "";
		String message2 = "";
		States state;
		state = States.W;
		int test = 0;

		while(reader.hasNext()) {
			test++;
			if(reader.hasNextInt()) {
				String value = String.valueOf(reader.nextInt());
				value = value.substring(value.length()-1);
				
				switch(state) {
				case W:	if(value.startsWith("0")) {
						state = States.Z;
						message = message + value;
					}
					break;
					
				case Z:	if(value.startsWith("1")) {
						state = States.O;
						message = message + value;
					}
					else {state = States.W;
							message = "";}
					break;
					
				case O:	if(value.startsWith("1") || value.startsWith("0")) {
						message = message + value;
						state = States.I;
					}
					else {state = States.W;
							message = "";}
					break;
					
				case I:	if(!(value.startsWith("1")|| value.startsWith("0"))) {
						state = States.W;
						
					}
					else {
						message = message + value;
						if(message.length()== 8) {
							message2 += (char)Integer.parseInt(message,2);
							message = "";
						}
					}
					break;
					
				}
				
			}
			else {reader.next();}
		}
		System.out.println(message2);
		System.out.println(test);
		
		

	}

}

@@ -108,18 +108,17 @@
 olver %7B%0A
-%09
 %0A
+
 %09enum St
@@ -132,18 +132,17 @@
 Z,O,I%7D;%0A
-%09
 %0A
+
 %09public 
@@ -194,19 +194,17 @@
 ption %7B%0A
-%09%09
 %0A
+
 %09%09Path f
@@ -312,24 +312,25 @@
 %09String 
-message2
+translate
  = %22%22;%0A%09
@@ -367,24 +367,8 @@
 s.W;
-%0A%09%09int test = 0;
 %0A%0A%09%09
@@ -533,21 +533,17 @@
 h()-1);%0A
-%09%09%09%09
 %0A
+
 %09%09%09%09swit
@@ -662,38 +662,33 @@
 %09%09%7D%0A%09%09%09%09%09break;%0A
-%09%09%09%09%09
 %0A
+
 %09%09%09%09case Z:%09if(v
@@ -830,38 +830,33 @@
 %22;%7D%0A%09%09%09%09%09break;%0A
-%09%09%09%09%09
 %0A
+
 %09%09%09%09case O:%09if(v
@@ -1027,30 +1027,25 @@
 %09%09%09%09%09break;%0A
-%09%09%09%09%09
 %0A
+
 %09%09%09%09case I:%09
@@ -1127,15 +1127,9 @@
 .W;%0A
-%09%09%09%09%09%09
 %0A
+
 %09%09%09%09
@@ -1216,24 +1216,25 @@
 %0A%09%09%09%09%09%09%09
-message2
+translate
  += (cha
@@ -1316,25 +1316,16 @@
 ak;%0A
-%09%09%09%09%09
 %0A
+
 %09%09%09%09%7D%0A
-%09%09%09%09
 %0A
+
 %09%09%09%7D
@@ -1379,53 +1379,19 @@
 tln(
-message2);%0A%09%09System.out.println(test);%0A%09%09%0A%09%09%0A
+translate);
 %0A%09%7D%0A

Remove test code