

<protocol>://<domain>.ru[/<context>]
where,
1. <protocol> can either be equal to "http" (without the quotes) or "ftp" (without the quotes)
2. <domain> is a non-empty string, consisting of lowercase English letters,
3. The /<context> part may not be present. If it is present, then <context> is a non-empty string, consisting of lowercase English letters.
'http://sun.ru/sunm', and 'ftp://guj.ru' are the valid address.
The first line contains an integer 'T' which denotes the number of test cases or queries to be run.
The first line of each test case contains one string ‘S’.
For each case, we need to print a string representing the internet address.
The output of each test case will be printed in a separate line.
You do not need to input or print anything, and it has already been taken care of. Just implement the given function.
1 <= T <= 5
1 <= |S| <= 50
Time limit: 1 sec.
Here we can use the property of substring and divide the string into 3 parts. A substring is a contiguous sequence of characters in a string. So we can take a substring of the first 3 characters of the string and a substring of the first 4 characters of the string and check whether that is equal to “ftp” or “http” respectively. Then we can cut the string from that point and start to find the first occurrence of “ru” in the string. Once we get the occurrence, the string before the occurrence of “ru” becomes our domain, and the string remaining after “ru” is our context. We can put all the three parts in their position provided context is not an empty string. If the context is an empty string, then we don’t need to add a reverse slash after “ru”.