for(;l=readline(S=[f=i=j=0]);print(~f?'failed at: '+(l.slice(j-1)||'EOL'):'yes'))for(;!f;x&1?f=S[i--]+x:S[++i]=~x)x='()[]{}<>'.indexOf(l[j++])
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page