p _[_][0]until def _ c=$<.getc%6 c<1?_[_]:proc{|x|c==3?x:c==4?x+1:proc{|y|c>4?x:proc{|z|x[z][y[z]]}}}end