TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description


You are writing your first website and seem to be making your fair share of
simple HTML syntax errors. You have decided to write an HTML parser to help
you determine if your HTML code is syntactically correct based on the
following condensed HTML definition:






































HTML CODE

BODY


BODY

TEXT

TEXT


STRING | STRING TEXT | TAG | TAG TEXT

STRING


possibly empty string of printable characters other than '<' and '>')

TAG

BOLD | ITALICS | LINK


BOLD

TEXT

ITALICS


TEXT

LINK

URL>TEXT


URL

http://STRING.com

Input Format

The first line contains a single integer n indicating the number of
data sets.


The following n lines each represent a data set and consists of up
to 1000 characters. Spaces can be contained anywhere within the data set.


Note that all tags are case sensitive.

Output Format


If the code is syntactically correct, the following string will be printed:


"Syntax Included"


Otherwise the following string will be printed:


"No Syntax Included"

Sample Input 1

3
&lt;HTML&gt;&lt;BODY&gt;&lt;B&gt;Hello world!&lt;/B&gt;&lt;/BODY&gt;&lt;/HTML&gt;
&lt;HTML&gt;&lt;BODY&gt;&lt;B&gt;Is this correct?&lt;/B&gt;&lt;/HTML&gt;
&lt;HTML&gt;&lt;BODY&gt;&lt;A HREF=http://www.go.com&gt;link&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;

Sample Output 1

Syntax Included
No Syntax Included
Syntax Included

Hints

Problem Source

Migrated from old NTUJ.

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 65536 200