give string represent code snippet implement tag validator parse code return validA code snippet valid follow rule holdthe code wrap valid closed tag otherwise code invalida close tag necessarily valid exactly follow format TAG_NAMETAG_CONTENTTAG_NAME among tag_name start tag tag_name end tag the tag_name start end tag a closed tag valid tag_name tag_content valida valid tag_name contain uppercase letter length range 19 otherwise tag_name invalida valid tag_content contain valid close tag cdata character note1 EXCEPT unmatched unmatched start end tag unmatched close tag invalid TAG_NAME otherwise tag_content invalida start tag unmatched end tag exist tag_name vice versa however need consider issue unbalanced tag nestedA unmatched find subsequent and find subsequent character parse tag_name necessarily validthe cdata follow format cdatacdata_content the range CDATA_CONTENT define character cdata subsequent cdata_content contain character the function cdata forbid validator parse cdata_content character parse tag matter valid invalid treat regular character example 1input code divthis line cdatadivdivoutput trueexplanation the code wrap closed tag DIV DIV the tag_name valid tag_content consist character cdata although CDATA_CONTENT unmatched start tag invalid TAG_NAME consider plain text parse tagso tag_content valid code valid thus return trueExample 2input code DIV cdata cdatadivdivoutput trueExplanationWe separate code start_tagtag_contentend_tagstart_tag divend_tag DIVtag_content separate text1cdatatext2text1 cdata cdata CDATAdiv cdata_content divtext2 the reason start_tag not DIV rule 6the reason cdata not CDATAdiv rule 7Example 3input code A B a boutput falseexplanation unbalance if a closed b unmatched vice versa Constraints1 codelength 500code consist english letter digit