def p(r): if r:print r l=raw_input();s=[];m="failed at: " while l:i="<{[(>}])".find(l[0]);s+=[i]*(i<4or i-s.pop()!=4and p(m+l));l=l[1:] p(["yes",m+"EOL"][len(s)>0]) p(0)