Result

AC

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 p != '')SELECT l FROM m WHERE l != ''

stdin

00101101
10010100
10101011
00100111
00001111
10011100
11001111
10000100
01000010
10111110
00000011
00100011
01110001
00000001
01111000
01100111
00000111
11011111
00000110
10001000
00000000
01001110
00110000
01001011
11111100
10010110
11100111
00100100
01101001
01000111
11111101
11100000
11010011
01111011
00100100
00110111
11001101
10011010
00010101
01011011
00010110
10011001
11010010
11001010
10000001
00011100
10011000
00011100
00001010
01101000

stdout

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

stderr

strace