Result

AC

Code [DL]

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

stdin

11000110
01011011
10001000
10000110
11100111
01000110
01011001
01000010
01111000
11100111
11111101
11001000
00010011
00000011
11010010
11110111
10101011
10111011
00101101
00011111
00000110
00001001
01101010
11100000
01110100
01000010
01111100
10100011
00101010
00100100
01101000
00000001
00110111
01111110
00001111
01001110
10111110
01110101
11010100
00010101
01101101
10001011
01101001
00010110
00011100
00001010
00000000
01101100
10011001
01001011

stdout

01101001111001101010100001000101101110010010111010

stderr

strace