import java.io.*; import java.util.*; import java.text.*; public class syntax { public BufferedReader br; public PrintStream ps; public String toString() { return "syntax"; } boolean success; public String html( String s ) { //System.out.println( "html: [" + s + "]" ); s = match( s, "" ); s = body( s ); s = match( s, "" ); return s; } public String body( String s ) { //System.out.println( "body: [" + s + "]" ); s = match( s, "
" ); s = text( s ); s = match( s, "" ); return s; } public String text( String s ) { //System.out.println( "text: [" + s + "]" ); s = s.trim(); if( s.startsWith("<") ) { if( s.startsWith("0 ) s = text( s ); return s; } public String string( String s ) { //System.out.println( "string: [" + s + "]" ); int p = s.indexOf( '<' ); int q = s.indexOf( '>' ); if( q>-1 && (q-1 ) s = s.substring( p ); else s = ""; return s; } public String tag( String s ) { //System.out.println( "tag: [" + s + "]" ); s = s.trim(); if( s.startsWith( "" ); s = text( s ); s = match( s, "" ); return s; } public String italics( String s ) { //System.out.println( "italics: [" + s + "]" ); s = match( s, "" ); s = text( s ); s = match( s, "" ); return s; } public String link( String s ) { //System.out.println( "link: [" + s + "]" ); s = match( s, "" ); s = text( s ); s = match( s, "" ); return s; } public String url( String s ) { //System.out.println( "url: [" + s + "]" ); s = match( s, "http://" ); s = address( s ); return s; } public String address( String s ) { //System.out.println( "string: [" + s + "]" ); int p = s.indexOf( '<' ); int q = s.indexOf( '>' ); if( q>-1 && (q
-1 )
{
String a = s.substring( 0, p );
s = s.substring( p );
if( !a.endsWith( ".com" ) )
{
success = false;
s = "";
}
}
else
{
success = false;
s = "";
}
return s;
}
public String match( String s, String token )
{
//System.out.println( "match: [" + s + "] [" + token + "]" );
s = s.trim();
if( s.length()>=token.length() && s.startsWith( token ) )
{
s = s.substring( token.length() );
}
else
{
success = false;
s = "";
}
return s;
}
public void doit() throws Exception
{
br = new BufferedReader( new FileReader( "syntax.in" ) );
ps = new PrintStream( new FileOutputStream( "syntax.out" ) );
//ps = System.out;
int i, j, k;
String tokens[];
int n = Integer.parseInt( br.readLine().trim() );
for( i=0; i