## partition by parity by emoken

```H
\$!d
s/.*//
x
s/\n//
s/\$/ /gm
:a
/\n/!bq
s/^\(.*\)\n\(.*\)\$/@\1: %\2/gm
:b
s/^[^%@:\n]*\$/~&/gm
s/^\(.*\)@\(.*\): % *\$/~\1\2/gm
s/^\(.*\)@: \(.*\)%\(.*\)/~\1\2\3/gm
/@/!be
x
s/\$/\n=m/
x
H
s/^~.*\$/~/gm
s/^.*@\(\w*\)*.*%\(\w*\)*.*\$/\1 \2/gm
x
s/\$/\n=n/
x
H
:1
s/^ \$/=/gm
s/^ .*/</gm
s/.* \$/>/gm
s/^[0-9]\|\b[0-9]//gm
t1
s/\n//g
G
s/\n.*=n//
x
s/\n=n.*//
x
:2
s/\`=\(.*\)\n\(.*\)\$/\1#\2/m
s/\`<\(.*\)\n\(.*\)\$/\1#</m
s/\`>\(.*\)\n\(.*\)\$/\1#>/m
s/\`~\(.*\)\n.*\$/\1#~/m
t2
s/#/\n/g
s/\n//
s/^/#/gm
:3
s/#\(.\)\(.*\) \(.\)\(.*\)/\1\3 #\2 \4/gm
t3
s/#//g
:4
s/00/=/g
s/0[1-9]/</g
s/[1-9]0/>/g
y/123456789/012345678/
/[0-9]/b4
s/ //gm
s/=*\(.\).*/\1/gm
s/\n//g
G
s/\n.*=m/#/
x
s/\n=m.*//
x
:m
s/^[<=]\(.*\)\n\(.*\)@\(\w*\) \(.*\)%\(\w*\)/\1-\2\3 @\4%\5/m
s/^>\(.*\)\n\(.*\)@\(\w*\)\(.*\)%\(\w*\) /\1-\2\5 @\3\4%/m
s/^~\([^\n]*\)\n~/\1-/
tm
s/-/\n/g
s/#\n//
bb
:e
s/~//g
ba
:q
s/ /\n/g
h
s/.*[13579]\n//gmp
g
s/.*[02468]\n//gmp
Q```

Note that non-ascii characters in the above source code will be escaped (such as \x9f).