Result

AC

Code [DL]

:$<;
(.+?)\n(.*);:,$($1) $2;
(.+)0:$1 $1
(.+)1:$1 $1"a"
1:"a"
.*,:"1"
(.*),\1(.*):a$1,$2
.:""
.*:"0"

stdin

00011100
10101011
00000001
00000110
00000011
00110011
11101000
00111101
01001101
01111000
11101010
10100011
00010101
01100011
11010010
00101101
11111101
00110111
00001111
01101001
00011011
01101001
11001001
11001100
11101110
00001110
01010101
10011001
11010100
00100100
00011000
10101011
11011010
01000010
00001010
10111110
00100110
10100010
10000001
11100111
11100000
10001000
01100010
01011011
01001110
00111100
00111110
10101101
11101100
00000000

stdout

11111000010010111111010000010101011100010101100001

stderr

strace