P19702 [HackerEarth] Snowden as we all know is good at stealing and parsing the resources from the internet. He has been threatened by the intelligence agencies to find our parliamentary members for surveill
普及
题目描述

Snowden as we all know is good at stealing and parsing the resources from the internet. He has been threatened by the intelligence agencies to find our parliamentary members for surveillance in one day time. The data would be safe if we are able to collect all the links in a site before him. So our goal is given a webpage source we have to extract all the links going to the same site.

A link will look like this

Note :

The order of links need to be preserved.i.e. the document needs to be scanned from left-right top-bottom fashion.

Input :

The First line is the website name.

Followed by the html content that ends with the string “exit” in a new line.

1 ≤ Length of each line ≤ 500

1 ≤ total number of lines ≤ 25

Output:

Output all the links that links to the same site.

SAMPLE INPUT
http://www.knowyourcandidate.net

<html> <head> <title></title> </head> <body> List Of Ministers Tamil Nadu MLA's Like us on Facebook Plus 1 on Google+ </body> </html>

exit

SAMPLE OUTPUT
http://www.knowyourcandidate.net/web/ministers/list/1
http://www.knowyourcandidate.net/mla-tamilnadu

Explanation

The first Two links, links to the same site www.knowyoucandidate.net whereas the next two links will go to facebook.com and plus.google.com

输入格式

见题面

输出格式

见题面

样例输入
http://www.mpmla.in <html> <head> <title></title> </head> <body> <a href="http://www.mpmla.in/web/ministers/list/1">List Of Ministers</a><a href="http://www.mpmla.in/mla-tamilnadu">Tamil Nadu MLA's</a> <a href="http://www.facebook.com/mpmla">Like us on Facebook</a><a href="http://plus.google.com/mpmla">Plus 1 on Google+</a> </body> </html> exit
样例输出
http://www.kyc.in/collectors http://www.kyc.in/articles http://www.kyc.in/primeministers