Mutilating the Query I know you've always thought about the trials and tribulations of experiencing the joys of life as a web proxy. Honestly, who hasn't? Today you're tasked with realizing this goal (at least a part of it). Website X gets a lot of traffic on the daily and is looking for a PaaS (clearly this refers to Proxy as a Service) because of the large number of users who insist on passing sensitive information via query parameters (users are silly). Your task is to remove any and all sensitive query parameters from the request before forwarding the request through to its original destination.

Input


A well-formed absolute HTTP URL that follows the URI grammar in RFC3986 Section 3.


You can assume there is no fragment
Brief format example where anything in square brackets denotes optional: http[s]://[user:pass@]host.name.com[:port]/[?param1=value1&amp;param2=value2...]

A list of query parameters to be removed.


Output

The modified HTTP URL without the parameters defined in the input list.

Examples

http://example.com/ [foo]
&gt; http://example.com/

http://example.com/?foo=bar []
&gt; http://example.com/?foo=bar

http://example.com/ []
&gt; http://example.com/

http://example.com/?foo=1&amp;bar=2&amp;baz=3 [foo,baz]
&gt; http://example.com/?bar=2

http://example.com/?foo=1&amp;bar=2&amp;baz=3 [foo,bar,baz]
&gt; http://example.com/

http://example.com/?foo&amp;bar=2&amp;baz= [foo,baz]
&gt; http://example.com/?bar=2

http://example.com/?abc=1&amp;def=2&amp;baz=foo [foo,bar]
&gt; http://example.com/?abc=1&amp;def=2&amp;baz=foo

http://example.com/?foobar=baz [foo]
&gt; http://example.com/?foobar=baz

http://foo:foo@foo.com:8080/?foo=1&amp;bar=foo [foo]
&gt; http://foo:foo@foo.com:8080/?bar=foo


Scoring

This is code-golf, so the shortest answer (in bytes) wins.
GNU sed 98 96 88 80 77 74 69 59 54 (48 + 1 for -r) 49

:;s,(.+)(=[^&amp;]*[&amp; ]|&amp;)(.*)\1,\3 ,
t;s,[?&amp;]? .*,,


The list of parameters to remove are separated by spaces.  

$ echo 'http://example.com/?foo=1&amp;bar=2&amp;baz=3 foo bar baz' | sed -rf sed.txt
http://example.com/

$ echo 'http://example.com/?foo&amp;bar=2&amp;baz= foo baz' | sed -rf sed.txt
http://example.com/?bar=2

$ echo 'http://example.com/' | sed -rf sed.txt
http://example.com/