Result

WA

Code [DL]

WITH RECURSIVE m(x,l,r,p) AS (
SELECT 1, '' AS l, substr(v,10) AS r, substr(v,1,8) AS p FROM i
UNION ALL
SELECT x + 1, CASE WHEN p='00000000' or p='00000001' or p='00000011' or p='00000110' or p='00001010' or p='00001111' or p='00010101' or p='00011100' or p='00100100' or p='00101101' or p='00110111' or p='01000010' or p='01001110' or p='01011011' or p='01101001' or p='01111000' or p='10001000' or p='10011001' or p='10101011' or p='10111110' or p='11010010' or p='11100111' or p='11111101' THEN 1 ELSE 0 END AS l, substr(r, 10) AS r, substr(r,1,8) AS p
FROM m
WHERE r != ''
)
SELECT l FROM m WHERE p != ''

stdin

10011001
00000001
00000110
10000111
10100001
01101001
00001001
00100100
11001010
11010111
10111111
11111101
11011001
10010110
11101101
00101101
00100101
11110100
01000110
01001110
10001000
11101100
00010101
10010101
00101000
11011101
00111101
10111000
10111001
00001111
00101110
11010010
00011001
01101000
01001110
11100111
01011011
00011100
01000010
10101011
00101100
00110111
01101010
10011100
00001010
01111000
00000000
10111110
00001111
00000011

stdout

1
1
1
0
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
1
0
0
0
0
0
0
1
0
1
0
0
1
1
1
1
1
1
0
1
0
0
1
1
1
1
1

stderr

strace