while""do l=io.read()repeat s=l:match"{%d+}"l=l:gsub(s,#s+2<2*#s:gsub(1,"")and 0 or 1)until#l<2 print(l)end