def w(a:Int*)=a map System.out.write
var b,i,j=1
while(b>0)w{b=System.in.read
if(b>10){j=b%4
if(b<72){i=b
j=2}
b}else{"\x00\x00\x01\x00\x00\x00"map{c=>i+=1-i/71*7
j+=i%3%2-c
w(32,i)
if(j%2>0)w(226,153,172+j)
if(j%4<1)w(240,157,132,171-j/4)}
10}}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).