In the early nineties, the World Wide Web (WWW) was invented. Nowadays, most people think that the WWW simply consists of all the pretty (or not so pretty) HTML pages that you can read with your web browser. But back then, one of the main intentions behind the design of the WWW was to unify several existing communication protocols.
Then (and even now), information on the Internet was available through a multitude of channels: FTP, HTTP, e-mail, news, Gopher, and many more. Thanks to the WWW, all these services can now be addressed uniformly through URLs (Uniform Resource Locators). For this problem we consider a simplified version of the URL syntax, which is as follows.
<protocol>://<host>[:<port>][/<path>]
The square brackets [ ] mean that the enclosed string is optional and may or may not appear. Some examples of URLs are:
http://www.informatik.uni-ulm.de/acm
ftp://acm.baylor.edu:1234/pub/staff/mr-p
gopher://veryold.edu
More specifically:
<protocol> is always one of http, ftp, or gopher.<host> is a string of alphabetic (a-z, A-Z) or numeric (0-9) characters, dots (.), dashes (-), and underscores (_).<port> is a positive integer smaller than 65536.<path> is a string that contains no spaces.Write a program that parses a URL into its components.
Gopher is an ancestor of today's WWW. It is now nearly extinct, but it was quite important when the WWW was invented.
The first line contains a single integer $n$, the number of URLs. Each of the following $n$ lines contains one URL in the format described above. Each URL consists of at most 60 characters.
For each URL, first print its number in the form URL #k (the first URL is URL #1). Then print four lines giving the protocol, host, port, and path, labelled Protocol, Host, Port, and Path. If the port and/or path are not given in the URL, print the string <default> instead of that value.
Each label is left-justified in a field of width 8 and joined to its value with =. Separate the output blocks of two consecutive URLs with a single blank line; the output ends with a trailing newline and no extra blank line. Follow the exact format shown in the examples below.