public class parser3
{
 public static void main(String argv[])
 {
	System.out.println("Content-type: text/plain");
	System.out.println("\n");

	if(argv.length == 0)
	{
	  System.out.println("No query string.");
	  System.exit(1);
	}	
	
	System.out.println("Your QUERY_STRING is:");
	System.out.println(argv[0]); 
	System.out.println("\nAfter cleaning:\n");

	String QUERY_STR = argv[0];
        QUERY_STR = QUERY_STR.substring(5);
	QUERY_STR = QUERY_STR.replace('+', ' ');
	int p;
	String table[] = {
		"%24",     "$",
		"%2C",     ",",
		"%0D",     " ",
		"%0A",     "\n",
		"%26",     "&",
		"%3A",     ".",
		"%3B",     ";",
		"%21",     "!",
		"%7E",     "~",
		"%23",     "#",
		"%2B",     "+",
		"%5E",     "^",
		"%2F",     "/",
		"%3F",     "?",
		"%27",     "'",
		"%28",     "(",
		"%29",     ")",
		"%25",     "%" };

	int i = 0;
	while( i < table.length ){

		while(true){
		    p = QUERY_STR.indexOf(table[i]);
		    if(p>=0){
		    QUERY_STR = QUERY_STR.substring(0,p) + 
			        table[i+1] 		 +
			        QUERY_STR.substring(p+3);
		    }
		    else break;
		}
	
		i = i + 2;
	}
	System.out.println(QUERY_STR);
  }
}

