#import int f(int c=0){read(0,&c,1)&&write(c/16%3?f(c&8&&f()):1,&c,1);}main(){f();main();}