perl -e '@stack = (); sub notify { return qq~!!!!@_[0]!!!~}; for(qw~+ - + - + - + + - +~) {push @stack, $_; (@stack[-2] ne $_ )? print 0 : print notify(1) };'