M=System.in.readLines()*.bytes T=['']*324 i=114 for(s=4;s>0;s=_[s+2]*4-256)T[(_=M[(T[i]?:0)+1])[s+1]%4?i++:i--]=_[s]%8 T.any''.&print